Results 1 to 3 of 3

Thread: TransactionManager per DAO?

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Nizhny Novrogod, Russia
    Posts
    6

    Default TransactionManager per DAO?

    I have several DAOs which all work with the same data resource (particularly, JCR), and some of them are even more specific, i.e., work only within the same node subtree.

    The question is, what is the best practice regarding TransactionManager-s configuration (by now I'm just using spring-modules-jcr LocalTransactionManager)?

    Specifically, should I have one transactionManager for each DAO, one transactionManager for all the DAOs that operate on the same data, or a separate transactionManagers for each DAO regardless of what data the DAO is accessing?

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

    Default

    Neither of your solutions...

    Transactions should be defined on your service layer not your dao layer. Also you only need 1 transactionmanager.

    I suggest you read chapter 9 of the reference guide which explains all about transactions.
    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
    Jan 2008
    Location
    Nizhny Novrogod, Russia
    Posts
    6

    Default

    Thanks, Marten for your reply, I think I've moved a bit closer to the understanding of how this must be designed.

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
  •