geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: G2.1.0 problem with OpenJPA
Date Wed, 20 Feb 2008 16:29:37 GMT
In my experience it's necessary to supply a non-jta-datasource as  
well as a jta-datasource.  Be sure the non-jta-datasource has <no- 
transaction> in the plan.  You can't set this using the admin console  
database pool wizard.  You can look at the plan in system-database  
for an example.

If this doesn't help please show your persistence.xml

thanks
david jencks

On Feb 19, 2008, at 8:23 AM, Łukasz Budnik wrote:

> 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.beforeCompleti 
> on(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