quality@glassfish.java.net

Re: _at_GeneratedValue(strategy = GenerationType.AUTO)

From: Adam Bien <abien_at_adam-bien.com>
Date: Wed, 03 Sep 2008 08:48:39 +0200

HI All,

I opened an issue:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=5836 regarding the
problem described below...

regards,

adam
Adam Bien schrieb:
> Hi all,
>
> @GeneratedValue(strategy = GenerationType.AUTO) does not work as with
> GF v2.
>
> GFV2 / TopLink essentials, would create a sequence for you. GF v3
> fails with the following error:
>
> Caused by: java.sql.SQLSyntaxErrorException: Die Tabelle/Ansicht
> 'SEQUENCE' ist nicht vorhanden.
> at
> org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown
> Source)
> at org.apache.derby.client.am.SqlException.getSQLException(Unknown
> Source)
> at org.apache.derby.client.am.Connection.prepareStatement(Unknown
> Source)
> at
> com.sun.gjc.spi.base.ConnectionHolder.prepareStatement(ConnectionHolder.java:475)
>
> at
> org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.prepareStatement(DatabaseAccessor.java:1340)
>
> at
> org.eclipse.persistence.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:648)
>
> at
> org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:550)
>
> ... 74 more
> Caused by: org.apache.derby.client.am.SqlException: Die
> Tabelle/Ansicht 'SEQUENCE' ist nicht vorhanden.
> at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
> at
> org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown
> Source)
> at
> org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown
> Source)
> at
> org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown
> Source)
> at
> org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown
> Source)
> at
> org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown
> Source)
> at
> org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown
> Source)
> at
> org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown
> Source)
> at
> org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown
> Source)
> at org.apache.derby.client.am.PreparedStatement.prepare(Unknown
> Source)
> at org.apache.derby.client.am.Connection.prepareStatementX(Unknown
> Source)
>
>
> is it a bug or feature?
>
> The persistence.xml is:
>
> <persistence-unit name="book" transaction-type="JTA">
> <jta-data-source>jdbc/sample</jta-data-source>
> <properties>
> <property name="eclipselink.ddl-generation"
> value="drop-and-create-tables"/>
> </properties>
> </persistence-unit>
> </persistence>
>
>
> GF v3 should behave in this area identically to GF v2 - just think of
> migration projects...
>
> regards,
>
> adam
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: quality-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: quality-help_at_glassfish.dev.java.net
>
>


-- 
 Consultant, Author, Java Champion
 
 Homepage: www.adam-bien.com
 Weblog: blog.adam-bien.com
 eMail:  abien_at_adam-bien.com
 Mobile: 0049(0)170 280 3144
 Books: Enterprise Architekturen (ISBN: 393504299X),
        Java EE 5 Architekturen  (ISBN: 3939084247),
        J2EE Patterns, J2EE Hotspots, Enterprise Frameworks and Struts