users@glassfish.java.net

Re: Glassfish CMP not cleaning up transactions

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Thu, 19 May 2011 13:31:15 -0700

It was a bug in 2.1 that rollback didn't clean the monitoring table.
When the monitoring is off, nothing wrong happens. The problem is fixed
in 3.1.

HTH,
-marina

forums_at_java.net wrote:
> I have multiple EJB's using Container managed persistance. I appear
> to be
> leaving the transactions open, however, with CMP, I thought, its the
> container that cleans up the transactions after a commit. This
> problem may
> also be me misunderstanding what I'm seeing. Allow me to explain.
>
> In glassfish (V2.1) I enable Monitoring of JTA and look at the
> Transactions
> Tab.
>
> I execute my program which invokes multiple EJB's that do
> inserts/updates to
> my database. In general, EJB's are marked with a TransactionAttribute of
> NotSupported, with the actual method that does the insert as
> RequiresNew.
> So when I exit the method, it should commit.
>
> After completion, the Transactions Tab shows multiple transactions, all
> listed as "No Transaction" in the "State" column. I do see some while
> the
> program is running marked as "Active" and some of them do go away.
> However,
> it always leaves the transaction. Some have been around over 67 hours.
> When I restart Glassfish, they go away. I'm assuming this is a
> transaction that was committed but not released. These never seem to be
> cleaned up.
>
> My code is doing injection for the entity manager and everything else is
> either using em.createNamedQuery().getResultList(),
> em.createQuery().executeUpdate(), or using the em.persist() or
> em.merge().
>
> Am I missing something (glassfish parameter, etc) or should I be doing
> some
> kind of close() in my code.
>
> Thanks for your help
>
>
>
>
> --
>
> [Message sent by forum member 'gsarrowood']
>
> View Post: http://forums.java.net/node/804259
>
>