DataNucleus - Products
  History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CORE-3255
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: Guido Anzuoni
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JPOX Core

JTATransactionImpl.isActive() does not report correct status if it joins JTA Transaction in isActive() method

Created: 08/May/07 11:57 AM   Updated: 04/Jul/07 01:50 PM
Component/s: Transactions
Affects Version/s: 1.2.0-beta-2
Fix Version/s: None


 Description  « Hide
Current implementation of isActive() is:

    public boolean isActive()
    {
        boolean isActive = super.isActive();
        if( isActive )
        {
            //do not join transaction if org.jpox.Transaction already started
            return true;
        }
        joinTransaction();
        return isActive;
    }

The following fragment causes a
org.jpox.jdo.exceptions.TransactionNotActiveException on makePersistente() call

            PersistenceManager pm = pmf.getPersistenceManager();

            ut.setTransactionTimeout(300);
            ut.begin();
            Product product = new Product("Sony Discman", "A standard discman from Sony", 200.00);
            pm.makePersistent(product);


Using the debugger it is clear that if
        boolean isActive = super.isActive();
returns false, the active JTA transaction is correctly joined with the call to joinTransaction(); that
correctly toggles active flag to true in the superclass.
unfortunately local method variable isActive is not updated so the result is still false.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson - 08/May/07 12:06 PM
Please see http://www.jpox.org/servlet/jira/browse/CORE-2734 for the issue about use of JTA without J2EE. I've put your comment on that one.