Hey
Nishi Nidamarty wrote:
> I'm not saying that the App Server cannot make use of the DataSource
> registered in JNDI.
> I'm interested if that would impact what an App Server can do in terms of
> controlling transactions in a component based framewok like EJB using a
> vendor provided DataSource.
* The Db would provide a XADataSource.
* The AppServer would request XAConnections from it.
* When acquired they would get XAResources from them, who in turn are
registered with the TM through
TransactionManager.getTransaction().enlistResource(...)
* The app server can then use the Transaction interface callbacks to
control the transaction flow.
* The TM will then call the XAResources accordingly.
And that's about it.
Is this clear? (Am I correct?)
> Will the DataSource class provided by the DB vendor, get the information from
> the App Server handling connection pooling, distributed tranactions? I guess
> these "hooks" in JDBC extensions address this. I'm wondering is this kind of
> manadatory in component based EJB framework where transaction demarcation is
> done at component level.If not how the App Server passes the "tx" details to
> the RM (local tx) or a TM (global tx)
As above, the AppServer registers the XAResources to the TM through the
Transaction interface (which is available in JNDI!), and can then use
the Transaction interface to issue commit and rollback calls. That is
the only responsibility that the appserver has (AFAIK).
> So you are saying that App Server is the one which informs the TM, so looks
As described in the JTA API, ch. 4.
> like it then needs to support these so called "hooks" (JDBC 2.0 std.
> extensions) by implemeting the "DataSource" class provided by the DB vendor.
No, why?
* The database can implement DataSource.
* The appserver binds these implementations in JNDI
* the appserver can then use these DataSources to acquire connections to
the database
* If the DB is transactional then the implementation is really a
XADataSource, and the appserver acts as outlined above
> Coming back again to my first question are these "hooks" kind of requirement
> or is it optional? which is still not clear to me :)
If the DB-vendor (or whoever implements the DataSource) wants the
database interaction to be transactional the XADataSource interface is
implemented, otherwise plain DataSource is implemented. As simple as
that.
I hope I'm not making this any more confusing... ah well...
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".