Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Oracle/OAS
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Devaka Cooray
Tim Cooke
Sheriffs:
Rob Spoor
Liutauras Vilda
paul wheaton
Saloon Keepers:
Tim Holloway
Tim Moores
Mikalai Zaikin
Carey Brown
Piet Souris
Bartenders:
Stephan van Hulst
Forum:
Oracle/OAS
Autonomous transaction in Oracle Using Java.
Bennet Xavier
Ranch Hand
Posts: 162
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I think I understand what you are asking. pseudo code could be something like this:
. Transaction trans = new Transaction(...); DBWithConn my_db = new DBWithConn(); . . my_db.persistTransactionPartA( trans.getPartA() ); if ( some condition ) { my_db. persistTransactionPartB( trans.getPartB() ); } my_db.commitTransaction();
Bennet Xavier
Ranch Hand
Posts: 162
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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 ?
Uh oh, we're definitely being carded. Here, show him this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Executing Stored Procs using EJB 3
Stored Procedure Synchronization
neat way to send excpetion back to java
setTransactionTimeout in CMP
Allow single transaction only
More...