Re: Run query NOT in transaction

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Oct 27 2009 - 12:01:55 EDT

  • Next message: Eugene R.: "Re: Run query NOT in transaction"

    Yeah, quite annoying. Here is a workaround:

    http://cayenne.apache.org/doc20/stored-procedures-and-transactions.html

    Andrus

    On Oct 27, 2009, at 5:54 PM, Evgeny Ryabitskiy wrote:

    > Hello 2 everyone!
    >
    > I have one problem with transaction policy in Cayenne.
    > I need to run some query without transaction. Why? I am using
    > Temporary Tables in T-SQL which can't be created in Transaction.
    > But Cayenne using transaction for every query.
    >
    > Here is example:
    >
    > If I run this Query:
    >
    > Create Table #MYTempTable (someid int)
    > Insert Into #MYTempTable (someid) Select 0
    >
    > I got:
    > java.sql.SQLException: There was a transaction active when exiting
    > the stored procedure '****'. The temporary table '#MYTempTable' was
    > dropped in this transaction either explicitly or implicitly. This
    > transaction has been aborted to prevent database corruption.
    >
    >
    > After some research I didn't find any ability to turn off transaction
    > for query. Maybe it will be nice to add some API parameter to change
    > this behavior? )
    >
    > Evgeny Ryabitskiy.
    >



    This archive was generated by hypermail 2.0.0 : Tue Oct 27 2009 - 12:02:24 EDT