Results 1 to 2 of 2

Thread: Replicating databases maintaining consitency

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    5

    Default Replicating databases maintaining consitency

    Hi,

    I 've a system which provisioned data into a database..., today's requieriment is to have two databases and perform certain actions on both databases.

    I 've achieved that by using a custom HibernateInterceptor combined with a custom implemntation of AbstractRoutingDatasource.


    What I couldn't do is to rollback commit on database1 if action on database2 fails.

    could anyone give me a hint on how to make the first transaction rollback if the second fails?

    Here I detail the interceptors I got running on my system in order:

    * HibernateInterceptor
    * TransactionInterceptor

    cheers, and thanks in advanced.

  2. #2
    Join Date
    May 2011
    Location
    New Delhi, India
    Posts
    157

    Default

    Since two different databases are involved you will have to use global (JTA) transactions. Please refer to Spring documentation for JTA configuration.

Tags for this Thread

Posting Permissions

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