Best practices: commit by database layer vs. commit by caller

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matthew Houseman

    Best practices: commit by database layer vs. commit by caller

    All,

    What's the accepted best practice for persisting data? Commit by the
    PL/SQL or commit by the caller (C#, Java, VB, etc.). I believe that
    if the caller starts a transaction and calls PL/SQL that contains
    commit/rollback that the XA Manager throws an exception. Since I
    can't predict what the caller of my PL/SQL could do, I'm leaning
    towards having the caller handle the transaction as a precondition of
    calling into the database layer.

    Comments are appreciated.

    Matt Houseman
  • Jim Kennedy

    #2
    Re: Best practices: commit by database layer vs. commit by caller

    "Matthew Houseman" <mhousema@ix.ne tcom.comwrote in message
    news:73986c9d.0 309171022.2053e 617@posting.goo gle.com...
    All,
    >
    What's the accepted best practice for persisting data? Commit by the
    PL/SQL or commit by the caller (C#, Java, VB, etc.). I believe that
    if the caller starts a transaction and calls PL/SQL that contains
    commit/rollback that the XA Manager throws an exception. Since I
    can't predict what the caller of my PL/SQL could do, I'm leaning
    towards having the caller handle the transaction as a precondition of
    calling into the database layer.
    >
    Comments are appreciated.
    >
    Matt Houseman
    Unless the entire pl/sql procedure is a transaction I would have the caller
    set the transaction boundries. Then the expectation of what do do with
    exception handling is clearer. Caller gets the exception and determines what
    to do (rollback, retry, commit, ask the user something, log it etc.).
    Jim


    Comment

    Working...