« Return to Thread: Does jencks canbe integrated with hybernate?

Re: Does jencks canbe integrated with hybernate?

by Arif Mohd :: Rate this Message:

Reply to Author | View in Thread

Hi gnodet,
   
       Could you please answer my question as explained above.Ofcourse i also attached activemq with the transaction manager and rolling back,commiting of transactions are happening perfectly.

      The flow is very simple once the message is posted in activemq these threads starts executing parallely if any one of thread fails all the processing of threads will be rolled back and even the message in activemq is rolled back.


But my business logic is all these processing logic(threads) are independent, so i want to execute them parallely but if one business operation fails none of them should succeed.

     so as you can see in the code iam just calling session.persist() method and not commiting to DB, once all the threads have completed their work iam calling commit on transaction manager(here i want to make use of transaction manager)  also all the DB operations are done in one thread.

     Does it make sence? or if you have any better idea of doing these(running parallely but atlast should be committed at one point) please let me know.

gnodet wrote:
As I already said, distributed transactions are transactions involving
several resources that may be remote (a database, jms broker, etc...).
 But such transactions must be used within a single thread.
So what you are trying to do is certainly not permitted by both jta and spring.

If you need the whole process to be transacted, the only choice is to
have everything running sequentially.  And the opposite: if you want
to work to be splitted across several threads (or even computers), you
can not use a single transaction.

If the processing time (apart from accessing the database) is length,
you could use several threads for it, but all database access must be
done from a single thread.

On 9/25/07, Arif Mohd <arif.mohammed1@wipro.com> wrote:
>
> Hi,
>
>    Iam new to this jencks and even to hybernate. Just i want to know can i
> integrate jencks with hybernate. My requirement is there are 3 threads, 2 of
> them are hybernate session threads doing some DB operation and one more
> thread is using ActiveMQ. I want to make use of jenks for maintaing
> distributed transactions over these threads
> --
> View this message in context: http://www.nabble.com/Does-jencks-canbe-integrated-with-hybernate--tf4514305.html#a12875825
> Sent from the jencks - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

 « Return to Thread: Does jencks canbe integrated with hybernate?