I have a requirement wherein I can't use application server or a TP monitor or any other s/w that enables nested transaction .
Requirement
===========
1. Multiple threads are doing some processing. Each thread should be able to do its portion.
2. Finally after all the threads are done I should do a final commit.
Solution
========
1. A controller creats a connection object and creats prepared statements for each thread and passes it to respective threads. I am not doing any commit in each thread, just executing queries.
2. Maintain a hashmap that keeps track of status of each thread and once all threads are done successfully, finally call commit on the connection object.
Problem
======
1. Since each thread is using the same underlying connection so this will be slow.
2. JDBC limits me in the way I can implement transaction and it doesn't support nested transactions.
Any ideas or better solutions???
-
Implementing transactions across threads without using J2EE (2 messages)
- Posted by: Neela datta
- Posted on: April 19 2002 21:07 EDT
Threaded Messages (2)
- Implementing transactions across threads without using J2EE by L Stitz on April 22 2002 03:45 EDT
- Implementing transactions across threads without using J2EE by Neela datta on April 22 2002 12:39 EDT
-
Implementing transactions across threads without using J2EE[ Go to top ]
- Posted by: L Stitz
- Posted on: April 22 2002 03:45 EDT
- in response to Neela datta
I replied to this in another forum. Please search for yourself, and note that it is not useful to post the same question in multiple forums.
:o) -
Implementing transactions across threads without using J2EE[ Go to top ]
- Posted by: Neela datta
- Posted on: April 22 2002 12:39 EDT
- in response to L Stitz
Thanks, actually I posted it on this thread and realized that it was the wrong thread to post to but I didn't know how it remove it from here.