<< Back to previous view

[GLASSFISH-378] java2db generating not valid DDL script, semi-column is missing. Created: 09/Mar/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: entity-persistence
Affects Version/s: 9.0pe
Fix Version/s: not determined

Type: Improvement Priority: Major
Reporter: bjb Assignee: pramodgo
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 378
Tags:
Participants: bjb, marina vatkina, pramodgo and Tom Mueller

 Description   

Having the following :

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="test" transaction-type="JTA">
<jta-data-source>jdbc/__default</jta-data-source>
<properties>
<property name="ddl-generation" value="dropandcreate"/>
<property name="create-ddl-jdbc-file-name" value="create.sql"/>
<property name="drop-ddl-jdbc-file-name" value="drop.sql"/>
<property name="toplink.platform.class.name"
value="oracle.toplink.essentials.platform.database.DerbyPlatform"/>
<!-- <property name="toplink.logging.level" value="FINEST"/> -->
</properties>
</persistence-unit>
</persistence>

And looking at the generated create.sql, each SQL statement are not separated by
a semi-column (, thus the generated DDL script is not valid and can not be
exacuted without manual correction by adding the missing semi-column.

This problem is existing on Derby, but it is anticipated that other java2db
flavor are behaving like that ! Please, fix this issue on derby and then double
check on other platforms as well.

Regards,
JB



 Comments   
Comment by marina vatkina [ 09/Mar/06 02:25 PM ]

The generated DDL is intended for JDBC execution.

Comment by bjb [ 09/Mar/06 02:40 PM ]

Tnx for the quick review of this issue.

I am sorry to insit, but if I copy paste this in a JDBC tool like SquirreL SQL,
the Derby JDBC database driver indicates the synthax is bad ! So, for me this is
not valid JDBC code. Am I missing something here ?

Having the semi-column (and in general a valid DDL script) will definitively
help people to do rapid development with Glassfish. Because it will help with
interroperability between glassfish artefacts and other tools.

So please reconsider fixing this. Maybe you can push this under "enhancement",
if you preffer ... although I do personally consider a DDL not beeing able to be
executed outside of GF as an issue.

Regards,
JB

Comment by marina vatkina [ 09/Mar/06 02:50 PM ]

Let's have it as an enhancement. Actually for CMP we generate 2 sets of files -
one for jdbc execution and one for command- or tool-based, but we didn't have
time to make major changes in TopLink code to allow that.

Regards,
-marina

Comment by Tom Mueller [ 06/Mar/12 09:57 PM ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-624] Downgrade SEQUENCE table creation warning to lower log level Created: 01/May/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: entity-persistence
Affects Version/s: 9.0pe
Fix Version/s: not determined

Type: Improvement Priority: Minor
Reporter: cayhorstmann Assignee: pramodgo
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Linux


Issuezilla Id: 624
Tags:
Participants: cayhorstmann, marina vatkina, pramodgo and Tom Mueller

 Description   

When DDL generation finds that a SEQUENCE table exists, it produces an unsightly
warning

[TopLink Warning]: 2006.05.01 07:37:40.619-ServerSession(8087689)-Exception
[TOPLINK-4002] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.apache.derby.client.am.SqlException: Table/View
'SEQUENCE' already exists in Schema 'APP'.Error Code: -1
Call:CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL,
PRIMARY KEY (SEQ_NAME))
Query:DataModifyQuery()

I presume that SEQUENCE is not deleted since it is shared by multiple apps
(which may not be a great design choice, but it's probably rather late to change
that). Then there should also not be a dire warning when it can't be created. If
you downgrade the log level, then a user can filter out this message while still
seeing more serious issues.



 Comments   
Comment by marina vatkina [ 01/May/06 04:47 PM ]

This is not easy to implement, as log level will need to depend on the
SQLException text, which can be different in different databases and drivers.

Comment by Tom Mueller [ 06/Mar/12 09:57 PM ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





Generated at Wed Apr 16 13:55:39 UTC 2014 using JIRA 4.0.2#472.