openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ritika Maheshwari" <ritikams...@gmail.com>
Subject JDBC SAvepointManager does not work
Date Tue, 16 Jan 2007 18:51:23 GMT
I have defined JDBC SavepointManager in my persistence.xml.I am running
against DB2 v9

<property name="openjpa.SavepointManager" value="jdbc"/>

Now a run a test client as follows

EntityManagerFactory emf = Persistence.
*

createEntityManagerFactory* ("dwtest");

EntityManager em = emf.createEntityManager ();

em.getTransaction().begin();

OpenJPAEntityManager kem = OpenJPAPersistence.*cast* (em);

kem.setSavepoint("savepoint1");

and I get following exception

Exception in thread "main" <0|false|0.0.0>
org.apache.openjpa.persistence.PersistenceException: An error occurred
attempting to invoke JDBC 3 method. Your driver or database may not support
JDBC 3 features.

at org.apache.openjpa.kernel.BrokerImpl.setSavepoint(BrokerImpl.java:1463)

at org.apache.openjpa.kernel.DelegatingBroker.setSavepoint(
DelegatingBroker.java:919)

at org.apache.openjpa.persistence.EntityManagerImpl.setSavepoint(
EntityManagerImpl.java:447)

at tutorial.ejb.Test.main(Test.java)

Caused by: org.apache.commons.lang.exception.NestableRuntimeException: An
error occurred attempting to invoke JDBC 3 method. Your driver or database
may not support JDBC 3 features.

at org.apache.openjpa.lib.jdbc.DelegatingConnection.invokeJDBC3(
DelegatingConnection.java)

at org.apache.openjpa.lib.jdbc.DelegatingConnection.setSavepoint(
DelegatingConnection.java:372)

at org.apache.openjpa.jdbc.kernel.JDBC3SavepointManager.setDataStore(
JDBC3SavepointManager.java)

at
org.apache.openjpa.jdbc.kernel.AbstractJDBCSavepointManager$ConnectionSavepoint.save
(AbstractJDBCSavepointManager.java:131)

at org.apache.openjpa.kernel.BrokerImpl.setSavepoint(BrokerImpl.java:1449)

... 3 more

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:64)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:615)

... 8 more

Caused by: org.apache.commons.lang.exception.NestableRuntimeException: An
error occurred attempting to invoke JDBC 3 method. Your driver or database
may not support JDBC 3 features.

at org.apache.openjpa.lib.jdbc.DelegatingConnection.invokeJDBC3(
DelegatingConnection.java)

at org.apache.openjpa.lib.jdbc.DelegatingConnection.setSavepoint(
DelegatingConnection.java:372)

... 12 more

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:64)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:615)

... 14 more

Caused by: org.apache.commons.lang.exception.NestableRuntimeException: An
error occurred attempting to invoke JDBC 3 method. Your driver or database
may not support JDBC 3 features.

at org.apache.openjpa.lib.jdbc.DelegatingConnection.invokeJDBC3(
DelegatingConnection.java)

at org.apache.openjpa.lib.jdbc.DelegatingConnection.setSavepoint(
DelegatingConnection.java:372)

at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.setSavepoint
(LoggingConnectionDecorator.java:296)

... 18 more

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:64)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:615)

... 21 more

Caused by: com.ibm.db2.jcc.c.SqlException: [ibm][db2][jcc][10123][10318]
Invalid operation: Cannot set savepoint, rollback to a savepoint, or release
a savepoint when in auto-commit mode.

at com.ibm.db2.jcc.c.p.setSavepoint(p.java:1341)

at org.apache.commons.dbcp.DelegatingConnection.setSavepoint(
DelegatingConnection.java:341)

at
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setSavepoint
(PoolingDataSource.java:345)

... 25 more



Any input is this a bug or do I need to set auto-commit to false.If so how
do I do that?

ritika

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message