If I cause all methods of an entity bean to have transaction attribute of RequiresNew, would the containing transaction still hold on lock on that entity bean?
Here is the problem: We have some entity beans that are locking because they are used pervasively. The invocation of those entity bean methods are pretty quick. The transactions they are in have performance issues. We don't want those entity beans to be locked for the duration of the containing transaction.
We're on 3.0.5 in production, though we are going to 3.2.1 in the next few weeks.
> If I cause all methods of an entity bean to have
> transaction attribute of RequiresNew, would the
> containing transaction still hold on lock on that
> entity bean?
No. New transaction is started before the container invokes your bean method. The locking is done after the tx.begin().