This is not precisely a contnuation of the current thread, but the header does
address my questions.

1.  Does the EJB spec specify two=phase commit for EJBs, via, I presuem, JTA?
That is, if I am runnign a transaction, with multiple emthod calls, each of
which should cause an update to the database, and hence, as I understand it, an
ejbSStore () (is this always called for an entity bean method?), at some point
the local resource managers have to do a commit().  What ifI'm accessing
multiple data sources?  Does he commit() in each resource manager happen and
then the transaction commit?  What if one resorue maanager fails to do a commit?
 Does the container take notice of this, and if so, how can it rollback changes
already committed in another resoruce amanger?

  Second, Javasoft recommends opening and closing db connections within 3very
database-related method.  That raises a problem for me, unless (I'mmissing
something.  Here's a scenario to show why:

  Mtthod a opens a connection, updates the database and closes the coonnection.
  Method B opens a connection, does some work and closes the connection.

  NOq, two questions:

  Assuming these two methods were called under the same transaction:
  If method B fails (could be in the same or a different bean), how does the
container know that it needs to rollback what happened in method A, since
there's no longer a "connection" between the bean instance and the database?
That is, nohting is tracking, so far as I know, what was changed by method A
anymore.  WIll this situation simply fail to call commit() on any local resource
maanger, thus causing the cahched changes (cached in the database) to be
ignroed?  Or what?  How will the dbms know that work done unde a different, now
gone, database connection needs to be rolled back, since commits are generally
done on a local resourcce manager on work done in a given connection.  That
connection, however, is now hitory.

  Ken Litwak

===========================================================================
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".

Reply via email to