Hi
I have a senario which is as follows .....
I have a Stateless Session Bean ( Bean Managed )
There is a Transaction that starts within this bean - transaction.begin()
A call is made to a CMP to insert some records
Some validations are made in the BMP, and accoriding to the outcome of the validations I need to either commit or rollback this Transaction. But when I try and rollback this transaction it fails. This is when I am using Weblogic7 SP4 with Oracle817 Drivers.
When I replace the CMP with a stored procedure, the Rollback still doesnt happen. I'm getting the connection from a TxDataSource.
Is there something that I'm missing/not doing in the DTD or the Weblogic Connection Pool setup ? ( I have tried autoCommit=false in the connection pool , but it does not work ! )
DTD ........... Given Below... (ejb-jar.xml)
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<description>FundIncome</description>
<ejb-name>FundIncome</ejb-name>
<home>com.xyz.FundIncomeHome</home>
<remote>com.xyz.FundIncome</remote>
<ejb-class>com.xyz.FundIncomeEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor></assembly-descriptor>
</ejb-jar>
Discussions
EJB programming & troubleshooting: Transaction Rollback Issue using Stateless Session Bean (BMP)
-
Transaction Rollback Issue using Stateless Session Bean (BMP) (5 messages)
- Posted by: orjun thengdi
- Posted on: April 07 2004 11:22 EDT
Threaded Messages (5)
- Transaction Rollback Issue using Stateless Session Bean (BMP) by Kumaraguruparan Karuppasamy on April 07 2004 18:00 EDT
- Transaction Rollback Issue using Stateless Session Bean (BMP) by orjun thengdi on April 07 2004 21:50 EDT
- Check TX Attribute of stateless session by Murugan K on April 08 2004 01:28 EDT
-
Check TX Attribute of stateless session by orjun thengdi on April 12 2004 08:55 EDT
- Check TX Attribute of stateless session by viresh wali on December 08 2005 11:14 EST
-
Check TX Attribute of stateless session by orjun thengdi on April 12 2004 08:55 EDT
- Check TX Attribute of stateless session by Murugan K on April 08 2004 01:28 EDT
-
Transaction Rollback Issue using Stateless Session Bean (BMP)[ Go to top ]
- Posted by: Kumaraguruparan Karuppasamy
- Posted on: April 07 2004 18:00 EDT
- in response to orjun thengdi
Check for the transaction-attribute for your CMP. Does it say "Required"?
KK -
Transaction Rollback Issue using Stateless Session Bean (BMP)[ Go to top ]
- Posted by: orjun thengdi
- Posted on: April 07 2004 21:50 EDT
- in response to orjun thengdi
Yes the Transaction Attribute iis set to 'Required', further even when I replace the CMP with a Stored Procedure, the Transaction Rollback dosent work! -
Check TX Attribute of stateless session[ Go to top ]
- Posted by: Murugan K
- Posted on: April 08 2004 01:28 EDT
- in response to orjun thengdi
Just want to know this,
R u using CMP Entity bean to communicate from the stateless session, isn't it?
What is the transaction attribute of the stateless session bean? -
Check TX Attribute of stateless session[ Go to top ]
- Posted by: orjun thengdi
- Posted on: April 12 2004 08:55 EDT
- in response to Murugan K
Its a Bean Managed Stateless Session Bean, hence will not have a txn State.
Further, I think I solved the problrm.... WL70 set autocommit for its Connection pool to 'true' by default. Though I do not know how to globally set the autocommit to 'false' using the WL console, I set the autocommit to 'false' in my code where I was using the Connection from the pool and this solved the problem. -
Check TX Attribute of stateless session[ Go to top ]
- Posted by: viresh wali
- Posted on: December 08 2005 11:14 EST
- in response to orjun thengdi
setting autoComit = false in the connection pool descriptor is not enough. it is also important to check weather the table type created in the database supports transactions.
e.g MYISAM table type in mysql doesnot support transactions where INNODB table type does.
So setting auto commit = false for MYISAM has no effect as the database server sets the auto commit flag to true by default for MYISAM table type.