I finally elected to go with a DAO pattern and hide everything in under 
that.  Each of the methods has alternates - one alternate will create 
it's own transaction - the other will not.  Transactions go with brokers 
(that is the "connection-level" in OJB), so whatever you do with a given 
broker is in the same transaction.

So I have methods with signatures like:

public void save(SomeDTO o);  // Gets it's own broker using utility classes
public void save(PersistenceBroker broker, SomeDTO o);

That's a very simple example :-) but I think you get the idea.  By 
having the alternate signature, I allow that DAO to participate in a 
transaction.  I've never dealt with EJBs, so I can't advise you on how 
to emulate that.

Anil Sharma wrote:

>Folks,
>
>Probably this question has been asked before. If yes, let me know I'll try
>to locate it within the archives.
>
>We are planning to use ojb (using broker api) within the context of
>stateless session beans (like a session facade replacing entity beans with
>our persistence broker (pb)  objects). 
>
>Any best practices for that. Like how and where would you make the objects
>transaction aware so that the transaction awareness is transparent to the
>objects implementation. 
>
>Regards,
>
>Anil
>
-- 
Eddie Bush




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to