AFAIK you should be able to have two transactions open at once, although
each one ties up a data base connection, so you might wind up running out
of connections, particularly in a one-user development environment. We had
a situation, a couple of versions of ND back, where once we began a
transaction, we could not execute db operations outside the context of the
transaction until either it was committed or rolled back.
I just have to ask, why are you using two transactions when each is
dependent on the other? Why wouldn't you just put your two inserts in one
transaction, e.g.:
>CSpTransaction tr1 = new CSpTransaction();
//note I am flipping the boolean and its tests
>boolean commitFlag = false;
>
>tr1.begin("dsSource");
>// in Full Manual mode, build sql and tr1.executeInsert(DoName)
> commitFlag = DoName.succeeded();
>if (commitFlag)
> {
> // in Full Manual mode, build sql and tr1.executeInsert(DoName)
> commitFlag = DoName.succeeded();
> }//if (commitFlag)
>
>if (commitFlag)
> {
> tr1.commit();
>}//if (commitFlag)
>else if tr1.isActive()
>{
> tr1.rollback();
>}//else if tr1.isActive()
Are you doing it this way because you have two inserts against the same
DO? That's not a problem if you go the 'full manual' route. You can't do
it in the 'full automatic' mode, for sure, and, maybe (not sure), the
'semi-automatic' mode.
-- Curt Springer, Team ND
At 08:48 AM 11/10/99 -0800, Ray wrote:
>Can anyone tell me if multiple transactions can be active at the same
>time? I.e.:
>
>CSpTransaction tr1 = new CSpTransaction();
>CSpTransaction tr2 = new CSpTransaction();
>boolean commitFlag = true;
>
>tr1.begin("dsSource");
>// in Full Manual mode, build sql and tr1.executeInsert(DoName)
>if (!DoName.succeeded() || command != PROCEED)
> commitFlag = false;
>if (commitFlag) {
> tr2.begin("dsSource");
> // in Full Manual mode, build sql and tr2.executeInsert(DoName)
> if (!DoName.succeeded() || command != PROCEED)
> commitFlag = false
> }
>
>if (commitFlag && tr1.isActive() && tr2.isActive()) {
> tr1.commit();
> tr2.commit();
>}
>else {
> tr1.rollback();
> tr2.rollback();
>}
>
>Does the beginning of transaction tr2, in effect, cancel tr1 (because a commit
>or rollback was not done for tr1 prior to beginning tr2)?
>_________________________________________________________________________
>
>For help in using, subscribing, and unsubscribing to the discussion
>forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
>For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]