You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "David Jencks (JIRA)" <de...@geronimo.apache.org> on 2005/09/12 23:40:30 UTC

[jira] Created: (GERONIMO-1004) SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)

SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)
------------------------------------------------------------------------

         Key: GERONIMO-1004
         URL: http://issues.apache.org/jira/browse/GERONIMO-1004
     Project: Geronimo
        Type: Bug
  Components: transaction manager  
    Versions: 1.0-M5    
    Reporter: David Jencks
 Assigned to: David Jencks 
     Fix For: 1.0-M5


Tranql's SequenceTablePrimaryKeyGenerator thinks it is doing its work in a new transaction, but it is not.  It breaks the current transaction, and fails if you are using an xa datasource.

The current openejb setup code does not allow for passing a separate ds in for the pk generator than for cmp.  Therefore it appears that essentially doing a "requires new" call is best.  However, the transaction module classes are not available in tranql since transaction depends on tranql (using a cache class).   I think moving the SequenceTable pk generator to openejb is the most practical short term solution but I will look for others.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (GERONIMO-1004) SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)

Posted by "Gianny Damour (JIRA)" <de...@geronimo.apache.org>.
    [ http://issues.apache.org/jira/browse/GERONIMO-1004?page=comments#action_12323301 ] 

Gianny Damour commented on GERONIMO-1004:
-----------------------------------------

I am OK with moving the code to OpenEJB as a short term solution.

I think that the long term solution is to pass the TransactionManagerDelegate to the SequenceTablePrimaryKeyGenerator and suspend and resume the transaction from there. This implies some changes to the PKGenBuilder interface.

I will work on that tonight.

> SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)
> ------------------------------------------------------------------------
>
>          Key: GERONIMO-1004
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1004
>      Project: Geronimo
>         Type: Bug
>   Components: transaction manager
>     Versions: 1.0-M5
>     Reporter: David Jencks
>     Assignee: Gianny Damour
>      Fix For: 1.0-M5
>  Attachments: pkgenerator.diff
>
> Tranql's SequenceTablePrimaryKeyGenerator thinks it is doing its work in a new transaction, but it is not.  It breaks the current transaction, and fails if you are using an xa datasource.
> The current openejb setup code does not allow for passing a separate ds in for the pk generator than for cmp.  Therefore it appears that essentially doing a "requires new" call is best.  However, the transaction module classes are not available in tranql since transaction depends on tranql (using a cache class).   I think moving the SequenceTable pk generator to openejb is the most practical short term solution but I will look for others.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (GERONIMO-1004) SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
    [ http://issues.apache.org/jira/browse/GERONIMO-1004?page=comments#action_12323303 ] 

David Jencks commented on GERONIMO-1004:
----------------------------------------

OK.  I guess that is a better solution, since tranql already knows about the tm.  I think we should just wait for your implementation.  If you run into difficulties we have mine as a backup.

> SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)
> ------------------------------------------------------------------------
>
>          Key: GERONIMO-1004
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1004
>      Project: Geronimo
>         Type: Bug
>   Components: transaction manager
>     Versions: 1.0-M5
>     Reporter: David Jencks
>     Assignee: Gianny Damour
>      Fix For: 1.0-M5
>  Attachments: pkgenerator.diff
>
> Tranql's SequenceTablePrimaryKeyGenerator thinks it is doing its work in a new transaction, but it is not.  It breaks the current transaction, and fails if you are using an xa datasource.
> The current openejb setup code does not allow for passing a separate ds in for the pk generator than for cmp.  Therefore it appears that essentially doing a "requires new" call is best.  However, the transaction module classes are not available in tranql since transaction depends on tranql (using a cache class).   I think moving the SequenceTable pk generator to openejb is the most practical short term solution but I will look for others.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (GERONIMO-1004) SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-1004?page=all ]

David Jencks updated GERONIMO-1004:
-----------------------------------

    Attachment: pkgenerator.diff

Patch intended for openejb, and it is not my code:

This issue should probably be at tranql and/or openejb, but it is here.  I have a solution that works, but it involves moving code from tranql to openejb.  I've attached the patch to modules/core/src/java/org/openejb/entity/cmp/pkgenerator/SequenceTablePrimaryKeyGeneratorWrapper.java  that moves the code, and I'm assigning it to the tranql code's author.

Gianny, can you comment on this issue whether you are OK with moving the code to openejb, if so I will commit it. (or you can if you prefer)

The basic idea is to use a TransactionPolicy interceptor to suspend the current transaction and get a connection within "no transaction".  If our interceptors supported setting tx isolation we could use the RequiresNew tx policy.

thanks
david jencks

> SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)
> ------------------------------------------------------------------------
>
>          Key: GERONIMO-1004
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1004
>      Project: Geronimo
>         Type: Bug
>   Components: transaction manager
>     Versions: 1.0-M5
>     Reporter: David Jencks
>     Assignee: David Jencks
>      Fix For: 1.0-M5
>  Attachments: pkgenerator.diff
>
> Tranql's SequenceTablePrimaryKeyGenerator thinks it is doing its work in a new transaction, but it is not.  It breaks the current transaction, and fails if you are using an xa datasource.
> The current openejb setup code does not allow for passing a separate ds in for the pk generator than for cmp.  Therefore it appears that essentially doing a "requires new" call is best.  However, the transaction module classes are not available in tranql since transaction depends on tranql (using a cache class).   I think moving the SequenceTable pk generator to openejb is the most practical short term solution but I will look for others.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (GERONIMO-1004) SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)

Posted by "Gianny Damour (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-1004?page=all ]
     
Gianny Damour closed GERONIMO-1004:
-----------------------------------

    Resolution: Fixed

This is now fixed.

SequenceTablePrimaryKeyGenerator:
1. suspends in-flight transactions
2. starts a new one to perform its operation
3. commit its transaction
4. resume the transaction suspended at step 1.

There was also another problem with the implementation: it was setting the auto commit in an XA connection, which is not allowed as pointed out by Jeremy. 

> SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)
> ------------------------------------------------------------------------
>
>          Key: GERONIMO-1004
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1004
>      Project: Geronimo
>         Type: Bug
>   Components: transaction manager
>     Versions: 1.0-M5
>     Reporter: David Jencks
>     Assignee: Gianny Damour
>      Fix For: 1.0-M5
>  Attachments: pkgenerator.diff
>
> Tranql's SequenceTablePrimaryKeyGenerator thinks it is doing its work in a new transaction, but it is not.  It breaks the current transaction, and fails if you are using an xa datasource.
> The current openejb setup code does not allow for passing a separate ds in for the pk generator than for cmp.  Therefore it appears that essentially doing a "requires new" call is best.  However, the transaction module classes are not available in tranql since transaction depends on tranql (using a cache class).   I think moving the SequenceTable pk generator to openejb is the most practical short term solution but I will look for others.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (GERONIMO-1004) SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-1004?page=all ]

David Jencks reassigned GERONIMO-1004:
--------------------------------------

    Assign To: Gianny Damour  (was: David Jencks)

> SequenceTablePrimaryKeyGenerator transaction handling is broken (Tranql)
> ------------------------------------------------------------------------
>
>          Key: GERONIMO-1004
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1004
>      Project: Geronimo
>         Type: Bug
>   Components: transaction manager
>     Versions: 1.0-M5
>     Reporter: David Jencks
>     Assignee: Gianny Damour
>      Fix For: 1.0-M5
>  Attachments: pkgenerator.diff
>
> Tranql's SequenceTablePrimaryKeyGenerator thinks it is doing its work in a new transaction, but it is not.  It breaks the current transaction, and fails if you are using an xa datasource.
> The current openejb setup code does not allow for passing a separate ds in for the pk generator than for cmp.  Therefore it appears that essentially doing a "requires new" call is best.  However, the transaction module classes are not available in tranql since transaction depends on tranql (using a cache class).   I think moving the SequenceTable pk generator to openejb is the most practical short term solution but I will look for others.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira