|
Hi Tony, I don’t think transaction boundaries
are the concerns of DAO. Generally stated transaction is a “cross-cutting
concern”. If you use EJB or one lightweight
container like Spring or HiveMind then transactions are supported _declaratively_ at any level (but
preferrably you should put them at service level). All the containers above are able to
create a transaction if no one exists at call time, or reuse the current
transaction if one is already open. And that happens without any transaction
management code anywhere! In any case (I mean: even if you don’t
use containers, be it EJB or lightweight), it is never a good idea to hard-code
the transaction boundaries at the DAO level, because your DAO has only one
responsibility: access one piece of data of your DB independently of any
transaction. Putting transactions there would be giving too much responsibility
to it (and prevent higher level services to define wider transactions). Transactions will most often embed many
calls to several DAOs, and you have to put your transaction boundaris to where
they belong (ie the services that call the DAO). Cheers Jean-Francois From: Tony Qian
[mailto:[EMAIL PROTECTED] All, |
- Atomic transaction in iBATIS Tony Qian
- RE: Atomic transaction in iBATIS Jean-Francois Poilpret
- RE: Atomic transaction in iBATIS Tony Qian
- Re: Atomic transaction in iBATIS Jeff Butler
- Re: Atomic transaction in iBATIS Tony Qian
- Re: Atomic transaction in iBA... Jeff Butler
- # in select statement Henry Lu
- Re: # in select state... Ted Schrader
