-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: I am getting "Transaction is no longer active" exc
PostPosted: Tue May 02, 2006 1:00 pm 
Newbie

Joined: Tue Feb 07, 2006 1:32 pm
Posts: 7
Location: Toronto, Ontario
Hi,

I have an SWLException during a transaction. As soon as I reset the connections (from the connection pool) in Weblogic console everything gets back to normal and I don't get this exception anymore. I saw this exception reported in Hibernate JIRA but was reported fixed in version 3.0.1 so I presume it is fixed in 3.0.2 as well

- Hibernate version: 3.0.2

- Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.intria.bip.pendingitems.dao"
schema="BIPPENDINGITEMS">
<class name="PendingItemRecordImpl" entity-name="GDPPendingItem"
table="GDP_PENDING_ITEMS" dynamic-update="true" select-before-update="true" optimistic-lock="none">

<id column="TXNID" name="id" type="string" length="100" unsaved-value="null"></id>

<timestamp name="createdTimestamp" column="CREATEDTS"></timestamp>

<property column="STATUS" insert="true" length="50"
name="status" not-null="true" type="string" unique="false"
update="true">
</property>
<set name="actions" inverse="true" cascade="all">
<key column="TXNID"></key>
<one-to-many class="ActionsRecordImpl"
entity-name="GDPActions" />
</set>
<property column="UPDATEDTS" insert="true" name="updatedTs"
not-null="false" type="timestamp" unique="false"
update="true">
</property>
<set name="items" inverse="true" cascade="all">
<key column="TXNID"></key>
<one-to-many class="ItemsRecordImpl" entity-name="GDPItems" />
</set>

</class>

<class name="ActionsRecordImpl" table="GDP_ACTIONS"
entity-name="GDPActions" dynamic-update="true" select-before-update="true" optimistic-lock="none">
<id column="ACTIONID" name="id" unsaved-value="null">
<generator class="sequence">
<param name="sequence">GDP_ACTION_SEQ</param>
</generator>
</id>
<many-to-one name="request" class="PendingItemRecordImpl"
entity-name="GDPPendingItem" column="TXNID" not-null="true">
</many-to-one>

<property column="METHOD" insert="true" length="25"
name="method" not-null="false" type="string" unique="false"
update="true">
</property>

<property column="ADDRESS" insert="true" length="4000"
name="address" not-null="false" type="string" unique="false"
update="true">
</property>

<property column="TYPE" insert="true" name="type"
not-null="true" type="int" unique="false" update="true">
</property>

</class>
<class name="ImagesRecordImpl" table="GDP_IMAGES"
entity-name="GDPImages" dynamic-update="true" select-before-update="true" optimistic-lock="none">

<id column="IMAGEID" name="id" unsaved-value="null">
<generator class="sequence">
<param name="sequence">GDP_IMAGE_SEQ</param>
</generator>
</id>
<many-to-one name="item" class="ItemsRecordImpl"
entity-name="GDPItems" column="ITEMID" not-null="true">
</many-to-one>

<property column="ITEMIMAGEID" insert="true" length="50"
name="itemImageId" not-null="true" type="string" unique="false"
update="true">
</property>

<property column="DESCRIPTION" insert="true" length="25"
name="description" not-null="true" type="string" unique="false"
update="true">
</property>

<property column="IMAGE" insert="true" name="image"
type="java.sql.Blob" unique="false" update="true">
</property>

<property column="IMAGEPATH" insert="true" length="255"
name="imagePath" type="string" unique="false" update="true">
</property>

<property column="IMAGEFORMAT" insert="true" length="10"
name="imageFormat" type="string" unique="false" update="true">
</property>

</class>
<class name="ItemsRecordImpl" table="GDP_ITEMS"
entity-name="GDPItems" dynamic-update="true" select-before-update="true" optimistic-lock="none">

<id column="ITEMID" name="id" unsaved-value="null">
<generator class="sequence">
<param name="sequence">GDP_ITEM_SEQ</param>
</generator>
</id>

<many-to-one name="request" class="PendingItemRecordImpl"
entity-name="GDPPendingItem" column="TXNID" not-null="true">
</many-to-one>

<property column="UNIQUECHEQUEID" insert="true" length="50"
name="uniqueChequeId" not-null="true" type="string" unique="false"
update="true">
</property>
<property column="STORAGECODE" insert="true" length="25"
name="storageCode" not-null="true" type="string" unique="false"
update="true">
</property>
<set name="images" inverse="true" cascade="all">
<key column="ITEMID"></key>
<one-to-many class="ImagesRecordImpl"
entity-name="GDPImages" />
</set>
<set name="itemData" inverse="true" cascade="all">
<key column="ITEMID"></key>
<one-to-many class="ItemDataRecordImpl"
entity-name="GDPItemData" />
</set>

</class>
<class name="ItemDataRecordImpl" table="GDP_ITEMDATA"
entity-name="GDPItemData" dynamic-update="true" select-before-update="true" optimistic-lock="none">

<id column="ID" name="id" unsaved-value="null">
<generator class="sequence">
<param name="sequence">GDP_ITEMDATA_SEQ</param>
</generator>
</id>
<many-to-one name="item" class="ItemsRecordImpl"
entity-name="GDPItems" column="ITEMID" not-null="true">
</many-to-one>

<property column="FIELDNAME" insert="true" length="1000"
name="fieldName" not-null="true" type="string" unique="false"
update="true">
</property>

<property column="FIELDVALUE" insert="true" length="1000"
name="fieldValue" not-null="true" type="string" unique="false"
update="true">
</property>

</class>
</hibernate-mapping>

- Code between sessionFactory.openSession() and session.close():
public static Session currentSession() {
Session s = (Session) session.get();
// Open a new Session, if this Thread has none yet
if (s == null) {
logger.debug("Session was null, creating a new one");
s = sessionFactory.openSession();
session.set(s);
} else if (!s.isOpen() || s.isDirty()){
logger.debug("Session is open " + s.isOpen());
logger.debug("Session is dirty " + s.isDirty());
s.close();
s = sessionFactory.openSession();
session.set(s);
}
return s;
}

try
{
//Save the record
this.session.save(this.entity, aRequest);
this.session.flush();
} catch (HibernateException e)
{
logger.error(">>>>>>>>>>>>>>>>>>>>>>>>>>Hibernate Exception");
PendingItemsUtil.closeSession();
throw e;
}

- Full stack trace of any exception that occurs:
java.sql.SQLException: The transaction is no longer active - status: 'Rolled back. [Reason=weblogic.transaction.internal.AppSetRollbackOnlyException]'. No further JDBC access is allowed within this transaction.
at weblogic.jdbc.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:219)
at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:228)
at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:78)
at weblogic.jdbc.wrapper.JTSConnection_oracle_jdbc_driver_T4CConnection.getWarnings(Unknown Source)
at org.hibernate.util.JDBCExceptionReporter.logAndClearWarnings(JDBCExceptionReporter.java:22)
at org.hibernate.jdbc.AbstractBatcher.closeConnection(AbstractBatcher.java:450)
at org.hibernate.jdbc.JDBCContext.disconnect(JDBCContext.java:181)
at org.hibernate.jdbc.JDBCContext.release(JDBCContext.java:88)
at org.hibernate.impl.SessionImpl.close(SessionImpl.java:274)
at org.hibernate.impl.SessionImpl.managedClose(SessionImpl.java:326)
at org.hibernate.transaction.CacheSynchronization.afterCompletion(CacheSynchronization.java:76)
at weblogic.transaction.internal.ServerSCInfo.callAfterCompletions(ServerSCInfo.java:853)
at weblogic.transaction.internal.ServerTransactionImpl.callAfterCompletions(ServerTransactionImpl.java:2789)
at weblogic.transaction.internal.ServerTransactionImpl.setRolledBack(ServerTransactionImpl.java:2636)
at weblogic.transaction.internal.ServerTransactionImpl.globalRetryRollback(ServerTransactionImpl.java:2866)
at weblogic.transaction.internal.ServerTransactionImpl.globalRollback(ServerTransactionImpl.java:2626)
at weblogic.transaction.internal.ServerTransactionImpl.internalRollback(ServerTransactionImpl.java:385)
at weblogic.transaction.internal.ServerTransactionImpl.rollback(ServerTransactionImpl.java:364)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:435)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
02/May/2006 10:08:50.505 DEBUG Transaction "" - [org.hibernate.jdbc.JDBCContext] after transaction completion

- Name and version of the database you are using: Oracle 9.1

- Debug level Hibernate log excerpt:
02/May/2006 10:08:50.480 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.SQL] /*update GDPPendingItem*/update BIPPENDINGITEMS.GDP_PENDING_ITEMS set CREATEDTS=?, UPDATEDTS=? where TXNID=?
02/May/2006 10:08:50.480 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.jdbc.AbstractBatcher] preparing statement
02/May/2006 10:08:50.480 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.persister.entity.BasicEntityPersister] Dehydrating entity: [GDPPendingItem#7320977162308920211146578918835Server_13]
02/May/2006 10:08:50.480 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.type.TimestampType] binding '2006-05-02 10:08:50' to parameter: 1
02/May/2006 10:08:50.480 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.type.TimestampType] binding '2006-05-02 10:08:50' to parameter: 2
02/May/2006 10:08:50.480 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.type.StringType] binding '7320977162308920211146578918835Server_13' to parameter: 3
02/May/2006 10:08:50.481 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.jdbc.AbstractBatcher] Adding to batch
02/May/2006 10:08:50.481 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.jdbc.AbstractBatcher] Executing batch size: 1
02/May/2006 10:08:50.482 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.jdbc.AbstractBatcher] success of batch update unknown: 0
02/May/2006 10:08:50.482 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
02/May/2006 10:08:50.482 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.jdbc.AbstractBatcher] closing statement
02/May/2006 10:08:50.482 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.event.def.AbstractFlushingEventListener] post flush
02/May/2006 10:08:50.504 DEBUG Transaction "" - [org.hibernate.transaction.CacheSynchronization] transaction after completion callback, status: 4
02/May/2006 10:08:50.504 DEBUG Transaction "" - [org.hibernate.jdbc.JDBCContext] after transaction completion
02/May/2006 10:08:50.504 DEBUG Transaction "" - [org.hibernate.impl.SessionImpl] after transaction completion
02/May/2006 10:08:50.504 DEBUG Transaction "" - [org.hibernate.transaction.CacheSynchronization] automatically closing session
02/May/2006 10:08:50.504 DEBUG Transaction "" - [org.hibernate.impl.SessionImpl] automatically closing session
02/May/2006 10:08:50.504 DEBUG Transaction "" - [org.hibernate.impl.SessionImpl] closing session
02/May/2006 10:08:50.504 DEBUG Transaction "" - [org.hibernate.jdbc.AbstractBatcher] closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
02/May/2006 10:08:50.504 DEBUG Transaction "" - [org.hibernate.util.JDBCExceptionReporter] could not log warnings
java.sql.SQLException: The transaction is no longer active - status: 'Rolled back. [Reason=weblogic.transaction.internal.AppSetRollbackOnlyException]'. No further JDBC access is allowed within this transaction.
at weblogic.jdbc.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:219)
at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:228)
at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:78)
at weblogic.jdbc.wrapper.JTSConnection_oracle_jdbc_driver_T4CConnection.getWarnings(Unknown Source)
at org.hibernate.util.JDBCExceptionReporter.logAndClearWarnings(JDBCExceptionReporter.java:22)
at org.hibernate.jdbc.AbstractBatcher.closeConnection(AbstractBatcher.java:450)
at org.hibernate.jdbc.JDBCContext.disconnect(JDBCContext.java:181)
at org.hibernate.jdbc.JDBCContext.release(JDBCContext.java:88)
at org.hibernate.impl.SessionImpl.close(SessionImpl.java:274)
at org.hibernate.impl.SessionImpl.managedClose(SessionImpl.java:326)
at org.hibernate.transaction.CacheSynchronization.afterCompletion(CacheSynchronization.java:76)
at weblogic.transaction.internal.ServerSCInfo.callAfterCompletions(ServerSCInfo.java:853)
at weblogic.transaction.internal.ServerTransactionImpl.callAfterCompletions(ServerTransactionImpl.java:2789)
at weblogic.transaction.internal.ServerTransactionImpl.setRolledBack(ServerTransactionImpl.java:2636)
at weblogic.transaction.internal.ServerTransactionImpl.globalRetryRollback(ServerTransactionImpl.java:2866)
at weblogic.transaction.internal.ServerTransactionImpl.globalRollback(ServerTransactionImpl.java:2626)
at weblogic.transaction.internal.ServerTransactionImpl.internalRollback(ServerTransactionImpl.java:385)
at weblogic.transaction.internal.ServerTransactionImpl.rollback(ServerTransactionImpl.java:364)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:435)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
02/May/2006 10:08:50.505 DEBUG Transaction "" - [org.hibernate.jdbc.JDBCContext] after transaction completion
02/May/2006 10:08:50.505 DEBUG Transaction "" - [org.hibernate.impl.SessionImpl] after transaction completion
02/May/2006 10:09:00.947 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.impl.SessionImpl] checking session dirtiness
02/May/2006 10:09:00.947 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.event.def.AbstractFlushingEventListener] flushing session
02/May/2006 10:09:00.947 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
02/May/2006 10:09:00.947 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] processing cascade ACTION_SAVE_UPDATE for: GDPPendingItem
02/May/2006 10:09:00.947 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.actions
02/May/2006 10:09:00.947 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] done cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.actions
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.items
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] done cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.items
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] done processing cascade ACTION_SAVE_UPDATE for: GDPPendingItem
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] processing cascade ACTION_SAVE_UPDATE for: GDPPendingItem
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.actions
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] done cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.actions
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.items
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] done cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.items
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] done processing cascade ACTION_SAVE_UPDATE for: GDPPendingItem
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] processing cascade ACTION_SAVE_UPDATE for: GDPPendingItem
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.actions
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] done cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.actions
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.items
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] done cascade ACTION_SAVE_UPDATE for collection: GDPPendingItem.items
02/May/2006 10:09:00.948 DEBUG Transaction "GDP_1146579331998" - [org.hibernate.engine.Cascades] done processing cascade ACTION_SAVE_UPDATE for: GDPPendingItem


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.