Subject Re: [IBO] Rollbacks
Author Jason Wharton
Not sure, we would have to know more about your application. I would think
you would either need to know to Post or Cancel before you were concerned
about doing a Commit or Rollback.

Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

-- We may not have it all together --
-- But together we have it all --


----- Original Message -----
From: "Malcolm Smith" <mjfreelancing@...>
To: "IBObjects List (E-mail)" <IBObjects@yahoogroups.com>
Sent: Thursday, September 05, 2002 4:54 PM
Subject: [IBO] Rollbacks


> If a user browses via a grid and presses the down arrow until the grid
goes
> into insert mode automatically, enters no data and then closes the form I
> get an exception because of missing required fields.
>
> Apart from asking the user if they want to commit, is this code the
correct
> way to handle it.
>
> if(transMaster->Started && !transMaster->InTransaction)
> {
> try
> {
> transMaster->Commit();
> }
>
> catch(...)
> {
> transMaster->Rollback();
> }
> }
>
> where transMaster is the transaction.
>
> I'm not doing any explicit transactions in my form.
>
>
> Malcolm Smith
> MJ Freelancing
> ABN: 30 671 763 146
> http://www.mjfreelancing.com