File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes Autonomous transaction in Oracle Using Java. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Autonomous transaction in Oracle Using Java." Watch "Autonomous transaction in Oracle Using Java." New topic
Author

Autonomous transaction in Oracle Using Java.

Bennet Xavier
Ranch Hand

Joined: Jun 19, 2008
Posts: 162
Hi All,

i got the connection using java.sql.Connection class.

i need to commit only a part of transaction and remaining thing is based on condition, i got information that, through Autonomous transaction we can archive this.

but, i dont know how to do this, please help me.

Bennet Xavier.
Agador Paloi
Ranch Hand

Joined: Jan 24, 2006
Posts: 118
I think I understand what you are asking. pseudo code could be something like this:

Bennet Xavier
Ranch Hand

Joined: Jun 19, 2008
Posts: 162
Hi,

Thanks for your reply.

please see the steps below...

1. Get the connection with auto commit false.

2. Perform database operation and don't commit.

3. Perform database operation Again and commit.(this place i need only step 3, database operation to be committed not step 2)

4. Perform database operation Again and don't commit.

5. roll back the connection.(step 2 and step 4 should be rolled back and nothing should happen to step 3.)

i need to achieve this with only one connection. how to do this.

If i am not clear, please let me know..

Thanks,

Bennet Xavier
Agador Paloi
Ranch Hand

Joined: Jan 24, 2006
Posts: 118
That helps, You want to do the steps using pl/sql autonomous stored procedures? Do you know how to write an autonomous
pl/sql procedure ?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Autonomous transaction in Oracle Using Java.
 
Similar Threads
Executing Stored Procs using EJB 3
Allow single transaction only
Stored Procedure Synchronization
neat way to send excpetion back to java
setTransactionTimeout in CMP