Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo]Invalid operation: Explicit COMMIT or ROLLBACK is not allowed when in auto-commit mode?
[Teneo]Invalid operation: Explicit COMMIT or ROLLBACK is not allowed when in auto-commit mode? [message #612474] Mon, 12 November 2007 15:42
Vladimir Nikolov is currently offline Vladimir NikolovFriend
Messages: 10
Registered: July 2009
Junior Member
Hello Martin,

I'm using Teneo/JPOX with setup datasource/connection pooling on
Websphere Application Server. It is setup by setting
PMFConfiguration.JDO_CONNECTION_FACTORY_NAME_PROPERTY in
JpoxDataStore.setProperties(properties).

When I run my application, on JpoxDataStore.initialize() I get the
following exception:

Exception = com.ibm.db2.jcc.c.SqlException
Source = com.ibm.ws.rsadapter.jdbc.WSJccSQLJConnection.rollback
probeid = 1860
Stack Dump = com.ibm.db2.jcc.c.SqlException:
[ibm][db2][jcc][10114][10307] Invalid operation: Explicit COMMIT or
ROLLBACK is not allowed when in auto-commit mode.
at com.ibm.db2.jcc.c.p.rollback(p.java:752)
at com.ibm.db2.jcc.c.gc.rollback(gc.java:162)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.rollback(WSJdbcCo nnection.java:2490)
at
org.jpox.store.rdbms.adapter.DB2Adapter.closeConnection(DB2A dapter.java:195)
at org.jpox.store.rdbms.RDBMSManager.closeConnection(RDBMSManag er.java:467)
at
org.jpox.store.rdbms.SchemaAutoStarter.<init>(SchemaAutoStarter.java:139)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:67)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:5 21)
at org.jpox.util.ClassUtils.newInstance(ClassUtils.java:73)
at org.jpox.store.StoreManager.initialiseAutoStart(StoreManager .java:383)
at
org.jpox.store.rdbms.RDBMSManager.initialiseSchema(RDBMSMana ger.java:735)
at org.jpox.store.rdbms.RDBMSManager.<init>(RDBMSManager.java:268)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:67)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:5 21)
at org.jpox.util.ClassUtils.newInstance(ClassUtils.java:73)
at
org.jpox.store.StoreManagerFactory.getStoreManager(StoreMana gerFactory.java:73)
at
org.jpox.AbstractPersistenceManager.getStoreManager(Abstract PersistenceManager.java:295)
at
org.jpox.AbstractPersistenceManager.<init>(AbstractPersistenceManager.java:217)
at org.jpox.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:42)
at
org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:178)
at
org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:153)
at
org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:515)
at
org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)

I started debbuging the problem and I found out that
connection.autoCommit property is set to true in
org.jpox.store.rdbms.adapter.DatabaseAdapter.getConnection() method.
Here is the code snippet:

if (isolationLevel == Connection.TRANSACTION_NONE) {
conn.setAutoCommit(true);
}
else {
if (conn.getAutoCommit()) {
conn.setAutoCommit(false);
}
....
}

This only happens with localPmf persistence manager factory from
JpoxDataStore.createSchema() method. At runtime, while using the default
pmf of the JpoxDataStore the autoCommit property is set to false in
DatabaseAdapter.getConnection() method.

Also at runtime(after JpoxDataStore.initialize() is over), I'm
observing a warning messages from time to time. The warning message says:
WLTC0033W: Resource jdbc/myDS rolled back in cleanup of
LocalTransactionContainment.
LocalTranCoor W WLTC0032W: One or more local transaction resources
were rolled back during the cleanup of a LocalTransactionContainment.

Probably the exception and the warning are related, but the exception
is thrown during initialization and the warnings are displayed during
runtime after the initialization is over.

Is there something I'm missing? An option to set or improper
initialization?

Thanks

Here is my configuration:
- ================ DatabaseAdapter ==================
16:42:17,694 (WebContainer : 0) INFO [JPOX.RDBMS] - Adapter :
org.jpox.store.rdbms.adapter.DB2Adapter
16:42:17,694 (WebContainer : 0) INFO [JPOX.RDBMS] - Datastore :
name="DB2/NT" version="SQL09010" (major=9, minor=1, revision=0)
16:42:17,694 (WebContainer : 0) INFO [JPOX.RDBMS] - Driver : name="IBM
DB2 JDBC Universal Driver Architecture" version="3.1.57" (major=3, minor=1)
16:42:17,694 (WebContainer : 0) DEBUG [JPOX.RDBMS] - Identifier Cases :
UPPERCASE "MixedCase-Sensitive"
16:42:17,694 (WebContainer : 0) DEBUG [JPOX.RDBMS] - Identifier Lengths
: Table=128 Column=30 Constraint=18 Index=18 Delimeters="
16:42:17,694 (WebContainer : 0) DEBUG [JPOX.RDBMS] - Identifier Support
in DDL : catalog=false schema=true
16:42:17,694 (WebContainer : 0) DEBUG [JPOX.RDBMS] - Statement Batching
: true
16:42:17,694 (WebContainer : 0) DEBUG [JPOX.RDBMS] - JDBC Types
supported : LONGVARCHAR, BINARY, TIMESTAMP, VARBINARY, TIME,
LONGVARBINARY, BIGINT, DATE, OTHER, CLOB, BLOB, DISTINCT, VARCHAR,
DOUBLE, REAL, SMALLINT, INTEGER, DECIMAL, CHAR


16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - ================ PMF
Configuration For Schema Creation================
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - JDK : 1.5.0 on Windows XP
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - JDO Standard Options
: singlethreaded, retainValues, nontransactionalRead
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - Persistence Options :
reachability-at-commit deletion-policy=JPOX
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - Datastore :
AutoCreate(Tables,Columns,Constraints),
Validate(Tables,Columns,Constraints), CheckTableViewExistence,
foreignKeyCreateMode=AUTO
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - Datastore Identifiers
: Factory="jpox"
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - MetaData : XML
Validation=true, File Suffixes (JDO = jdo, ORM = orm, JDOQUERY =
jdoquery), ORM Mapping name=(none)
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - Datastore Connection
Pooling : None
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - Types Control :
stringDefaultLength=255, dateTimezone=UTC
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - Initialisation :
mechanism=SchemaTable, mode=Quiet
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - Transactions :
type=ResourceLocal, mode=pessimistic, isolation=READ_COMMITTED POID -
isolation=READ_COMMITTED, connection=New
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - ClassLoading : jdo
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - Cache : Level1
(org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache), Collections/Maps
16:41:26,753 (WebContainer : 0) DEBUG [JPOX.JDO] - Queries :
fetchSize=0, fetchDirection=forward, resultSetType=forward-only,
resultSetConcurrency=read-only


16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - ================ PMF
Configuration Runtime ================
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - JDK : 1.5.0 on Windows XP
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - JDO Standard Options
: singlethreaded, retainValues, nontransactionalRead
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - Persistence Options :
reachability-at-commit deletion-policy=JPOX
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - Datastore :
AutoCreate(None), Validate(None), CheckTableViewExistence,
foreignKeyCreateMode=AUTO
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - Datastore Identifiers
: Factory="jpox"
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - MetaData : XML
Validation=true, File Suffixes (JDO = jdo, ORM = orm, JDOQUERY =
jdoquery), ORM Mapping name=(none)
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - Datastore Connection
Pooling : None
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - Types Control :
stringDefaultLength=255, dateTimezone=UTC
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - Initialisation :
mechanism=Classes, mode=Quiet, classes= .........here are listed a lot
of classes....
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - Transactions :
type=ResourceLocal, mode=pessimistic, isolation=READ_COMMITTED POID -
isolation=READ_COMMITTED, connection=New
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - ClassLoading : jdo
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - Cache : Level1
(org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache), Collections/Maps
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] - Queries :
fetchSize=0, fetchDirection=forward, resultSetType=forward-only,
resultSetConcurrency=read-only
16:42:16,991 (WebContainer : 0) DEBUG [JPOX.JDO] -
===================================================
Previous Topic:[EMF] Generate RAP instead of RCP
Next Topic:[CDO] server memory leak
Goto Forum:
  


Current Time: Sun Apr 21 21:14:42 GMT 2024

Powered by FUDForum. Page generated in 0.03304 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top