geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Łukasz Budnik" <lukasz.bud...@gmail.com>
Subject G2.1.0 problem with OpenJPA
Date Tue, 19 Feb 2008 16:23:28 GMT
Hi!

There is some kind of error in OpenJPA used in G 2.1.0 or... in DB2
Tranql wrapper.

Let's say I have a very simple entity class with following id field:

@Id
@SequenceGenerator(name = "MessageSeq", sequenceName = "message_seq")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "MessageSeq")
@Column(name = "ID_MESSAGE", nullable = false)
private Long idMessage;

the above class works fine with OpenJPA 1.0.1 in a stand-alone application.
I can persist objects, and that the new ID is taken from the
"message_seq" sequence.

BUT, the very same class throws this error when running on Geronimo 2.1.0:

102296  NuntiusPU  TRACE  [http-0.0.0.0-8080-1] openjpa.jdbc.SQL - <t
16171097, conn 33348549> [140 ms] spent
17:07:03,640 WARN  [Transaction] Unexpected exception from
beforeCompletion; transaction will roll back
<openjpa-1.0.1-r420667:592145 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: null
        at
org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.getConnection(AbstractJDBCSeq.java:162)
        at
org.apache.openjpa.jdbc.kernel.NativeJDBCSeq.nextInternal(NativeJDBCSeq.java:209)
        at
org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
        at
org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
        at
org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
        at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:557)
        at
org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:450)
        at
org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:426)
        at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:541)
        at
org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
        at
org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:501)
        at
org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2770)
        at
org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
        at
org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:940)
        at
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1892)
        at
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
        at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
        at
org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)

My shot is that there must be something wrong with the AbstractJDBCSeq...

If I comment-out the:

@SequenceGenerator(name = "MessageSeq", sequenceName = "message_seq")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "MessageSeq")

and assign the ID manually it works, but this is not what I want.

Any ideas?

best regards
Łukasz
Mime
View raw message