Results 1 to 4 of 4

Thread: HibernateTransactionManager+Multiple Threads

  1. #1

    Default HibernateTransactionManager+Multiple Threads

    Hi all,

    Is there any way of binding the transaction scope to a different thread. I am using HibernateTransactionManager. There is a need in which I have to bind to execution threads to a single transaction scope.

    I have put up the transaction boundaries on the service layer. The second thread is generated from inside a service class itself.

    Regards,
    nitin

  2. #2
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default

    The Hibernate session is not threadsafe and should not be shared between threads.

    So I think you need a different solution to your sitation and because you didn't provide much information about your situation, it is hard to provide a different solution.

  3. #3

    Default

    Hi,

    Here is my problem in more detail:

    In my application if user updates a particular entity, then application is required to schedule quartz jobs. I am using JDBC job store of Quartz for this purpose.
    Since there can be many jobs, I have seperated the threads in which this is done with the help of Apache camel & SEDA i.e. I have made the process of entity update & job scheduling asynchronous.
    I would like the job scheduling to roll back if there is any exception with the entity CRUD but not otherwise. This is why I thought that if I can make the transaction manager to handle both these processes, it will be great.

    Will appreciate a nice, easy & safe solution for this problem.

    Regards,
    Nitin

  4. #4

    Default

    Is it possible to listen to a transaction events, such as Commits & rollbacks. If that can be done then I can start the second process after listening to the result of the first process.

    Regards,
    Nitin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •