Page 3 of 3 FirstFirst 123
Results 21 to 22 of 22

Thread: Architectural Considerations: Spring, Hibernate and the Domain Model

  1. #21
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    I guess here is some misunderstanding - I do not see any post here that objects to making service transactional.

    Quote Originally Posted by dejanp View Post
    I must admit i don't really understand what speaks against making services transactional and use simple "required" (default) transaction propagation.

    Service methods are in most cases represent units of work or have to be used as a part of larger unit of work and that's exactly what you can achieve by making them transactional.

  2. #22
    Join Date
    Sep 2004
    Posts
    1,086

    Default

    I have started a new system as well. And have started down the road of exposing my Business Model objects which are hibernate persistance objects to my service layer. The problem I see is whe you have lazy initialization. It just does not seem right to me that the service layer has an object which has an attribute called say itemList which is a set of Item objects. However, since the itemList is lazily initialized it can not access it without opening a transaction/session. It seems that your data access layer now creeps into your service layer, and your service layer now has to know that something is lazily initialized or eagerly fetched. I am at a cross roads now as to best implementation.
    Sorry, forgot to quote.

Posting Permissions

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