openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ericp56 <eric.phettepl...@twcable.com>
Subject Oracle Identity
Date Thu, 04 Dec 2008 16:35:29 GMT

Hello,

I'm using Geronimo, and an Oracle XA database pool.

I've followed the steps to create a sequence in Oracle, and have added a
trigger to the table so the PK is set automatically using the sequence.


I've added in my persistence.xml 

<!-- Needed for retrieving the ID from newly inserted records-->
<property name="openjpa.jdbc.DBDictionary"
value="oracle(UseTriggersForAutoAssign=true,
AutoAssignSequenceName=SCHEDULER.OUTBOUNDREQUESTID)" />

<property name="openjpa.Log" value="File=/tmp/org.apache.openjpa.log,
DefaultLevel=TRACE, Runtime=TRACE, Tool=TRACE, SQL=TRACE"/>  


In my code, I have:
em.setFlushMode(FlushModeType.AUTO); //without this, I'll receive errors
about local transactions not allowed.
OutboundRequest OR = new OutboundRequest();
...
em.persist(OR)
...
return OR.getId();  <--- at this point, I see this in my JPA trace log:

81345  CallScheduler  TRACE  [http-0.0.0.0-8080-1] openjpa.jdbc.SQL - <t
14554376, conn 13978923> executing prepstmnt 23391158 INSERT INTO
SCHEDULER.OutboundRequest (application, AppParameters, callend, callstart,
created, destinationuri, mppserverid, mppsessionid, numberofretries,
priority, requestend, requeststart, timezone, Status, CallBehavior, Result)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(int) 2,
(Reader) java.io.StringReader@198339e, (null) null, (null) null, (Timestamp)
2008-12-04 11:15:51.0, (String) sip:boo@home.net, (null) null, (null) null,
(int) 2, (int) 0, (null) null, (Timestamp) 2008-12-04 11:15:51.0, (int) -5,
(int) 1, (null) null, (null) null]
81408  CallScheduler  TRACE  [http-0.0.0.0-8080-1] openjpa.jdbc.SQL - <t
14554376, conn 13978923> [47 ms] spent
81408  CallScheduler  TRACE  [http-0.0.0.0-8080-1] openjpa.jdbc.SQL - <t
14554376, conn 13978923> executing prepstmnt 11481820 SELECT
SCHEDULER.OUTBOUNDREQUESTID.currval FROM DUAL
81517  CallScheduler  TRACE  [http-0.0.0.0-8080-1] openjpa.jdbc.SQL - <t
14554376, conn 13978923> [109 ms] spent

At this point, I receive the error:

11:16:36,017 ERROR [CallScheduler] CreateRequest(sip:boo@home.net, DD Survey
App, x=1;y=2) failed.
<openjpa-1.0.3-r420667:677674 fatal general error>
org.apache.openjpa.persistence.PersistenceException: The transaction has
been rolled back.  See the nested exceptions for details on the errors that
occurred.
org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2108)
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1955)
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1853)
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1624)
org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:505)
org.apache.openjpa.kernel.StateManagerImpl.assignField(StateManagerImpl.java:590)
org.apache.openjpa.kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1465)
org.apache.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java:1448)
com.twcable.ivr.scheduler.Outboundrequest.pcGetid(Outboundrequest.java)
com.twcable.ivr.scheduler.Outboundrequest.getId(Outboundrequest.java:76)
com.twcable.ivr.scheduler.CallScheduler.CreateRequest(CallScheduler.java:131)
...

And there are no more exceptions, nor are there errors in my JPA log. 
I've run the SQL commands manually and they work fine.

Any suggestions? 
-- 
View this message in context: http://n2.nabble.com/Oracle-Identity-tp1614228p1614228.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message