Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Transactions across multiple DAOs

  1. #1
    Member
    Join Date
    Mar 2011
    Posts
    114
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Transactions across multiple DAOs

    I have DB operations to be done through multiple DAOs in one transaction. Is is possible to do it using simple JDBC calls?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Transactions across multiple DAOs

    Quote Originally Posted by tcstcs View Post
    I have DB operations to be done through multiple DAOs in one transaction. Is is possible to do it using simple JDBC calls?
    Yes, you can update a database with a transaction using JDBC.

  3. #3
    Member
    Join Date
    Mar 2011
    Posts
    114
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Transactions across multiple DAOs

    Then, do you suggest to pass connection objects from one DAO to other? If so, is it a good practice?

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Transactions across multiple DAOs

    Quote Originally Posted by tcstcs View Post
    Then, do you suggest to pass connection objects from one DAO to other? If so, is it a good practice?
    The question is quite vague, making it difficult to answer. But read about connection pools

Similar Threads

  1. Replies: 1
    Last Post: April 26th, 2012, 10:06 AM
  2. Replies: 6
    Last Post: December 9th, 2011, 05:53 PM
  3. How to use multiple actionlisteners
    By pottsiex5 in forum AWT / Java Swing
    Replies: 9
    Last Post: November 19th, 2011, 09:37 AM
  4. Multiple Problems
    By ZeroLRS in forum What's Wrong With My Code?
    Replies: 6
    Last Post: August 16th, 2011, 07:33 AM
  5. help with using multiple classes
    By finalfantasyfreak15 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 5th, 2011, 12:18 AM