Results 1 to 10 of 10

Thread: Commons transaction and Spring

  1. #1
    Join Date
    Apr 2007
    Posts
    3

    Default Commons transaction and Spring

    Hi

    Have anyone used commons transaction with Spring? I got a service who writes to both database and filesystem, this must be done inside a transaction (XA). The service uses 2 DAO's, one for DB and another one for FS. The transaction is set set using spring xml config on the service layer (at the moment it only works for DB DAO). Has anyone done anything like this before me?

    Regards
    Bjørn Ove

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    You can simply configure a JTATransactionManager in Spring. Just make sure your datasource and filesystem access is XA enabled and you should be good to go.

    Search the forum because I'm sure it came up before.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Apr 2007
    Posts
    3

    Default

    Hi mdeinum

    I have enabled XA in DB transactions using Spring and JOTM (running Tomcat). How do i configure commons transaction to use XA in Spring config, any idea/sample.

    Thanks in advance!

  4. #4
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    The file system access in Commons Transaction is not yet XA enabled, but it's planned.

    Jörg

  5. #5
    Join Date
    Mar 2007
    Location
    Chennai, India
    Posts
    53

    Default

    you have to wait till its JTA enabled then........
    JTA transaction Manager works only with XA enabled resources

  6. #6
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Quote Originally Posted by Jörg Heinicke View Post
    The file system access in Commons Transaction is not yet XA enabled, but it's planned.
    I thought someone had all ready said they'd done this before. After reading this I remembered who it was .

  7. #7
    Join Date
    Apr 2007
    Posts
    3

    Default

    OK

    Thanks for replaying to my question guys. I have to make a "work-around" for my problem then..

    Regards
    Bjørn Ove

  8. #8
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    Quote Originally Posted by karldmoore View Post
    I thought someone had all ready said they'd done this before. After reading this I remembered who it was .
    Bummer! Was it so obvious

    I might regret making this public ...

    I started implementing it on the weekend. Don't expect too much too fast. At least I'll have some testers out there

    Jörg

  9. #9
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Quote Originally Posted by Jörg Heinicke View Post
    Bummer! Was it so obvious

    I might regret making this public ...

    I started implementing it on the weekend. Don't expect too much too fast. At least I'll have some testers out there
    , that's the trouble putting it in print. Once it's out there you can't take it back.

  10. #10
    Join Date
    Mar 2010
    Posts
    11

    Default

    Hi,

    Commons Transaction does not support XA transactions, afaik. You can use XADisk to perform the file operations inside the XA transaction. This same XA transaction can include other XA-enabled resources like database also.

    Hope that helps.

    Thanks,
    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
  •