These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Generic transaction abstraction for NHibernate and Entity Fr
PostPosted: Mon Mar 15, 2010 11:10 am 
Newbie

Joined: Mon Mar 15, 2010 10:56 am
Posts: 1
I am looking for an example of how to use some generic transaction abstraction, making it easy to switch Repository implementations between e.g. NHibernate or Entity Framework.

(Regarding the mentioned "Repository" I am talking about a DDD repository, and if the reader may not be aware of the DDD repository, then please see http://en.wikipedia.org/wiki/Domain-driven_design )

I believe a solution might involve System.Transactions.TransactionScope or the Spring.AOP Transaction attribute.
If possible, I would like to find some good example code illustrating how client code can be truly independing of the current repository implementation, not needing to be modified when replacing the repository implementation.

An interesting example would be an application layer method which instantiates two Repository implementations (probably by using some dependency injection framework to avoid the coupling to concrete repository implementation classes) which both will invoke some persisting code (Inserts/Updates/Deletes) and then the client code in the application layer should either commit the changes explicit (or implicit commit/rollback with Spring AOP).

/ Tomas


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.