Re: JBoss transactions

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Aug 24 2004 - 14:52:07 EDT

  • Next message: Tore Halset: "Re: Unable to build the right expression"

    On Aug 24, 2004, at 1:31 PM, David Norwood wrote:
    > this is always in the log file after each DB access (probably correct):
    >
    > 2004-08-23 18:03:10,305 INFO
    > [org.objectstyle.cayenne.access.QueryLogger] +++ no commit -
    > transaction controlled externally.

    Yes, that's expected. Cayenne simply tells that it is done working with
    DB, and now it is up to the container to commit.

    > I'm getting table updates ok, (ie, the table gets the row) but the
    > Oracle sequence doesn't seem to be incrementing. So when I enter
    > another row, I get a pk unique violation, and it's because the
    > sequence hasn't been incremented. If I then force several updates,
    > even though I get an error each time, the sequence increments, and
    > eventually the table will accept the row.

    Hmm, as far as I know Oracle sequences are not transactional in a
    traditional sense. So new sequence value is immediately visible to all
    transactions without a need to do a commit. I just did a quick test to
    confirm my sanity, and this is indeed so, at least when using SQLPlus
    on Oracle 9i.

    Could you track down what exactly happens in your case? Do you have a
    log confirming that the same PK number is being used twice within an
    application? The one that you posted shows the failure, but not where
    the other record was inserted. There maybe other reasons why you have
    duplicate PKs in the db (e.g. manual rows insert).

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Aug 24 2004 - 14:52:15 EDT