On Sun, May 06, 2001 at 09:09:39PM -0400, marc fleury wrote:
> Ok,
> 
> I read a lot of confusion here, and I am very confused.
> 
> Short answer, it belongs in jboss.xml.

Short disagreement, no it doesn't.  Although I think this is actually what
you argue for in the long answer.

> However first things first.  We do not implement transaction isolation
> settings on the database connections we get (do we?).  I want to understand
> how to implement it.
> 
> Re: Transaction isolation level.  It is a JDBC only call and we set it once
> on the connection.  The database isolates the *records* that are accessed by
> the application server by enrolling these in the transaction that is running
> and releasing the records when the transaction is done.
> 
> It is then my understanding that when a driver enrolls a resource it must do
> so through the XA protocols and I am fuzzy as to who registers the XA
> resource in the ongoing transaction.  Do the minerva pools make sure that if
> there is a JBoss transaction then we register a listener?

Yes.  If you look in XAPoolDataSource or somesuch then it asks the transaction
manager for the current transaction and enlists an XAResource with it.

> Do the connectors provide a unified way to do this, how do they map to say a
> Oracle driver or a postgreSQL driver.

This is what javax.sql.XADataSource is for, abstracting this out.  Things
are complicated by the fact that almost nobody has a JDBC driver that
implements the javax.sql stuff properly.  Hence Minerva's XADataSourceImpl
et. al., which just fake it.

> Another question I have is the following: what is the default isolation
> level set on databases with JDBC? I would imagine that since there is very
> little usage of JTS infrastructure that there is *very* spotty support for
> the stuff I described... jdbc is such a mess.

I think the default isolation level is vendor-specific (i.e. there is none).
This is unrelated to JDBC driver support.

> Simply speaking, we can define the transaction isolation tag in jboss.xml
> that is the easy part, what we do with it is still a bit of a mistery... I
> am not surprised that Mad Andy couldn't get it to work in WebLogic.
> 
> |> Does anyone have opinions on whether this would be a good feature or
> |> not? The 1.1 spec does not specify how isolation levels should be
> |> handled, except for BMT session beans, and by saying/implying that beans
> |> can call resource manager specific APIs to set it themselves (carefully).
> 
> sure, still how does the driver listen for the JBoss demarcation, if someone
> can explain that clearly to me it would be great.  But to answer your
> question directly, I would say that *possibly* CMT/CMP is the only one where
> we *need* to specify the isolation level.

The JCA spec spells out how connections get enlisted in the appropriate
transaction.  Essentially, when the application asks the connection factory,
e.g. javax.sql.DataSource, for a connection, the connection factory calls
back to the application server through the ConnectionManager interface.  This
is how the app server hooks in its "quality of services" such as connection
pooling, security and transactions.

> |What do mean by "cover BMP and CMP entities as well as sessions"?  This
> |can only apply to JDBC connections, right?  Do you propose to set the
> 
> Yes,
> 
> |isolation level when a connection handle is obtained by the bean?  If
> 
> In case of CMP/BMP whenever we obtain a connection we need to set the
> isolation levels on it.  We would need to put these calls in the CMP code
> for jaws and we can set it ourselves (explicit call).  In the case of BMP it
> is a bit more complicated as the only indirection that we have is that one
> that comes out of the naming and the one in the pools which are today
> minerva.  We would need to either find the wrapper JCA approach to do it
> with JBoss or pass jboss.xml information to minerva.  Again, in both cases,
> I am interested in hearing clearly how this is implemented by the driver
> vendors (does postgresSQL support this for example)

As far as I'm concerned, JCA is the only way to get resource connections.
This means that we can simply hook in at the ConnectionManager.

> Also I find myself wondering if a BMP call should not be set by the bean
> directly... i.e. let's NOT go through 1000 lines of code to save the bean
> developer **1** line.

Agree.

> |so, this should probably be implemented using the same mechanism I have
> |in mind to implement beans hanging onto connection handles across
> |transactions.
> |
> |JBossCX defines the JBossConnectionListener interface for this purpose,
> |although it is not currently used.  The idea is that when a resource
> |adapter gives out a connection handle, the app server is notified so
> |that it can make sure it is participating in the correct transaction.
> |It would be easy to extend that to any transaction-specific setup we
> |wanted to do.
> 
> Ok so in that indirected code the appserver is notified of the fact the
> connection was handed out and I assume that the connection object is passed
> to the container.  You would have to cast that connection to a "JDBC"
> connection and set the isolation levels on it.  The locking is clearly an
> application level issue (lock these records like this) since the same
> connection can access different records we set the isolation at the
> container level ** with app knowledge**  and that is controlled by JBoss.
> 
> In case of CMP we can set the transaction isolation levels in the jaws code,
> we are in the body of the container code (CMP) and we can take a look at the
> isolation levels passed by the jboss.xml.
> In case we are BMP... it becomes really complex since the bodies of code
> where we can indirect (the naming and the container notification you show in
> JCA) have **no** knowledge of the application flow (or does JCA know?)... in
> ANY case, I would argue that in case of ***BMP*** we SHOULD'NT set anything
> ourselves and if I remember the spec correctly (but these memories get
> fuzzy) we must NOT set anything in BMP... the user does it ... one freaking
> line in his body of code.

I agree.  You are arguing against your short answer here.

> CMP' case is trivial.  We just go in the JAWS code where we "get" the
> connection and we set the isolation level (everytime?) on it.  Again I would
> really appreciate someone explaining clearly to me the "under the hood" of
> how a driver listens for JBoss demarcations (the association of the thread
> is JBoss only, how can Oracle know that we are running in front of them.. I
> JUST DON'T SEE THAT!!!!!!! can JCA help there at ALL?).  But again it would
> be TRIVIAL to implement the CMP case (2 lines of code).  The BMP case I
> argue that we don't have to do ANYTHING.  The CMT/BMT cases are irrelevant.

The JCA spec should be able to clear up the demarcation issue for you.

It seems to me that the isolation level is a useful setting for CMP only, so
it should be set in jaws.xml.

Toby.

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to