File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Transactions " Watch "Transactions " New topic
Author

Transactions

Sujit Nene
Greenhorn

Joined: Apr 02, 2001
Posts: 6
Hi,
In my ejb project i have used container managed transactions. I am using weblogic as ejb container. But i have found that transactions are not taking place. I am firing multiple sql queries on different tables in one of method of a session bean. It does not rollback even if one of the queries fail.
Can anybody tell what may be the cause of this?
with regards,
Sujit
John Bateman
Ranch Hand

Joined: Mar 09, 2000
Posts: 320
Hi
What does your deployment descriptor look like for that session bean?


SOURCE CODE should be SURROUNDED by "code" tags.
Steve Chernyak
Ranch Hand

Joined: Oct 19, 2000
Posts: 113
Are you using a DataSource for your querry?
I think you might hava to setup TxDataSource and use it for stuff that needs to be a part of transactions
Sujit Nene
Greenhorn

Joined: Apr 02, 2001
Posts: 6
Originally posted by John Bateman:
Hi
What does your deployment descriptor look like for that session bean?

Hi John,
This is how my deployment descriptor looks like. I have a session bean TestDoneManager. I am firing multiple sql queries in its 'addTestDone' method and creating 'Bug'.
<?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 >
< ejb-name>ATP.TestDoneManager< /ejb-name>
< home >com.seipl.atp.services.TestDoneManagerHome< /home>
< remote >com.seipl.atp.services.TestDoneManager< /remote >
< ejb-class>com.seipl.atp.services.TestDoneManagerEJB< /ejb-class >
< session-type >Stateful< /session-type >
<transaction-type >Container< /transaction-type >
< ejb-ref >
< ejb-ref-name >ATP.Bug< /ejb-ref-name >
< ejb-ref-type >Entity< /ejb-ref-type >
< home >com.seipl.atp.entity.beans.BugHome< /home >
< remote >com.seipl.atp.entity.beans.Bug< /remote >
< /ejb-ref >
< resource-ref >
< res-ref-name >ATP-Data-Source< /res-ref-name >
< res-type >javax.sql.DataSource< /res-type >
< res-auth >Container< /res-auth >
< /resource-ref >
< /session >
< /enterprise-beans >

< assembly-descriptor >
< container-transaction >
< method >
< ejb-name >ATP.TestDoneManager< /ejb-name >
< method-name >addTestDone< /method-name >
< /method >
< trans-attribute >RequiresNew< /trans-attribute >
< /container-transaction >
< /assembly-descriptor >
< /ejb-jar >
- Sujit
[This message has been edited by Sujit Nene (edited June 15, 2001).]
Sujit Nene
Greenhorn

Joined: Apr 02, 2001
Posts: 6
Originally posted by Steve Chernyak:
Are you using a DataSource for your querry?
I think you might hava to setup TxDataSource and use it for stuff that needs to be a part of transactions

Hi Steve,
I am using a data source. It is not a TxDataSource. I went through documentation provided by weblogic. As my transactions span local database i do not need TxDataSource as they are primarily used for distributed transactions.
- Sujit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transactions