Gabriel Lawrence writes:
> I have an EJB Session Bean who has a method called approve(). In the
> approve method it finds a specific entity bean and changes a value on
> that bean. Next, inside the same method it executes a SQL command that
> makes use of the table from which the previous entity bean came from in
> addition to several other tables. What I've found is that since all of
> this occurs inside the same Transaction, and the entity bean doesnt
> update the database until the end of the Transaction is that when I run
> my SQL the change I've made to the entity bean hasn't been reflected in
> the database. This seems reasonable to me, as you wouldn't want to hit
> the database every time an Entity beans methods are called, but it seems
> to me that there should be a checkpoint command that flushes things to
> the database, but doesn't end the transaction...
This is related to the "finder methods specifications" thread that was
live a few days ago. That thread included discussion about the correct
semantics for two instances using the same underlying database state.
In both cases I would want to assume (performance considerations
aside) that the container did the magic so that the view is consistent
within a single transaction. Gabriel agrees with me that for this to
happen the container might have to call ejbStore many times within a
single transaction. I had always assumed that this was so, and
involved tight integration of container and database (which the JDBC
API would not be sufficiently rich to support).
>From the responses on this list, including several from vendors, I now
believe that this was fantasy. If so, I'm disappointed that EJB relies
on the underlying RDBMS to provide transactional boundaries and is
consequently unable to provide stronger, more object-oriented,
consistency guarantees.
Further, is Gabriel's case even deterministic? Can't the EJB server do
an ejbStore whenever it likes?
- Phil
===========================================================================
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".