ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: iBatis and EJB
Date Sun, 06 Feb 2005 16:58:41 GMT
> it is possible to create *one* implementation of a DAO that behaves
> differently when under
> an EJB context and differently when *outside* an EJB context?

Absolutely.  Your Java source will not have to change, only the
transaction manager configuration.  You can choose to use a JTA or
EXTERNAL transaction manager type for working with declarative
transactions (depends on your server, configuration etc.).  When using
local transactions, you use the JDBC tranaction manager.

In all cases you follow the same try/finally start/commit/end
paradigm.  Calling commit with a JTA transaction may or may not commit
depending on the existing context, whereas EXTERNAL will NEVER commit
and depends completely on an external transaction manager.

Clinton






On Sun, 06 Feb 2005 09:31:24 +0200, Abdullah Kauchali
<abdullah.kauchali@isanusi.com> wrote:
> 
> 
> friendVU admin wrote:
> 
> > Did you ask if distributed 2 phase commits are done without EJB?
> > Of course! You can do that in iBatis by itself. And in Tomcat or Resin
> > by itself.
> > sqlMap or JBDC.commit() or rollback().
> > Or even in SQL by itself.
> >
> 
> No, no ... I know we can do 2-phase commits without EJB's.  What I'm
> asking is whether
> it is possible to create *one* implementation of a DAO that behaves
> differently when under
> an EJB context and differently when *outside* an EJB context?
> 
> I'll give you an example:
> 
> Suppose there is an insertProducts SQLMap with its appropriate DAO class
> that manages
> the execution of the insert statement *but* in a local transaction
> scenario only.  Now,
> suppose we want to expose that same SQLMap to other development
> environment that
> want to participate with insertProducts transactionally but with 2PC.
> Is it possible to wire only the
> EJB specific classes on top and deploy it, or do you have to create an
> entirely separate
> DAO that has EJB logic in it and then dish out that new API to the
> external developers?
> 
> Sorry for the confusion .... It's not a serious question ... yet ...I am
> under stress here on
> another stupid project ... I keep reading the iBatis stuff because it is
> too interesting.  :)
> 
> Regards
> 
> Abdullah
>

Mime
View raw message