-->
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.  [ 2 posts ] 
Author Message
 Post subject: Session bean to control transaction error
PostPosted: Wed Jul 14, 2004 9:00 am 
Beginner
Beginner

Joined: Tue Jun 22, 2004 3:16 pm
Posts: 35
I am using stateless EJB to communication Hibernate (Weblogic 8.1). In order to control transaction in EJB, I have following in ejb-jar.xml:

<container-transaction>
<method>
<ejb-name>MySessionBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>

I am getting error:
java.sql.SQLException: Cannot call Connection.commit in distributed transaction. Transaction Manager will commit the resource manager when the distributed transaction is committed.
In either trun on/off hibernate transaction feature, it still happens. But if I remove EJB transaction from ejb-jar.xml, it works fine. I am wondering if it is possible to control HIbernate transaction over EJB.

JW


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 14, 2004 3:53 pm 
Beginner
Beginner

Joined: Tue Jun 22, 2004 3:16 pm
Posts: 35
I figured that out. I have to flush the session.


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

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.