File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Autonomous transaction in Oracle Using Java.

 
Bennet Xavier
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I understand what you are asking. pseudo code could be something like this:

 
Bennet Xavier
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic