On 30 Sep 00, at 1:29, Oleg Nitz wrote:
> >> But I foresee the next problem. For HIGH/LOW key generator I would
> >> like to get the additional Connection, to write new value to the
> >> database table holding occupied key values and to commit
> >> this modification *immediately*, whether the main transaction will
> >> commit or rollback. Is it possible with EJB CMT?
>
> DO> I believe the standard way to do this is to have a session bean
> DO> method with a "requires new" transaction attribute. Hope this
> DO> helps.
> Sure. In standard conditions.
> This all happens "inside" jBoss since CastorJDO is an MBean serving as
> a bean resource manager. Probably, it should create a new transaction
> "from inside" as if it was a session bean method with a "requires new"
> transaction attribute, right?
Hi Oleg,
(LOL). I think my brain was turned off when I wrote this e-mail.
Sorry; obviously you don't want to have a session bean as part of
the implementation of your MBean resource manager. As Homer
Simpson would say, "Doh!"
Actually, I think this need to get an additional connection might be
more general than just HIGH/LOW key generators. We also could
need it in a persistence manager (e.g. Jaws, but more likely an
EJB 2.0 persistence manager) that implemented optimistic
concurrency. One connection would be used to read the data
outside of the existing primary transaction. A second, joined to the
existing transaction, would be used to commit changes to the data
assuming that it had not been modified in the interim. This would
minimize the scope and time in which write-locks were held on the
database.
The EJB 2.0 draft specification recommends (and suggests that a
later specification will require) that persistence managers obtain
resource manager connection factories through JNDI from the
java:pm/env subcontext. Obviously an MBean is different from a
persistence manager, but we might want to adopt this standard for
MBeans as well. You could then declaratively express in a server
configuration file the transaction characteristics of the resources
that you retrieve: enlisted in the transaction or not. Any thoughts?
-Dan
P.S. I'll try to read your e-mails before responding to them from
now on!
>
> Regards,
> Oleg
>
>
>