Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-669

NativeSequences can be incremented within the business transaction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.6, 0.9.7, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0
    • 1.2.0
    • None
    • None

    Description

      SQL Sequences are independent of the transaction. Therefore the same connection which is used to insert a row can be used to increment the sequence value.

      Currently we treat these native sequences in the same manner as updating a sequence table - ie the work will be done on connection2 (aka the non-jta-data-source). This appears to be unnecessary and requires an additional datasource when running in a managed environment which can't suspend the current transaction

      To resolve the problem I added a nativeSequenceType attribute to the DBDictionary class. This setting will be used to determine the whether the databases sequences are transactional, contiguous or non transactional (Default is contiguous). If the native sequences are transactional or contiguous they will be executed within the current transaction and will not require a second connection factory.

      Attachments

        Activity

          People

            mikedd Michael Dick
            mikedd Michael Dick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: