On Wed, 2006-04-19 at 13:36 +0300, Adrian Maier wrote:
> On 4/19/06, Joost van der Sluis <[EMAIL PROTECTED]> wrote:
> > Several other databases have support for more then one transaction. This
> > means that if you want to execute a query, you have to tell in which
> > transaction the query should be executed. There are no real standard
> > sql-commands for this, but consider something like this:
> 
> The one thing that is unclear for me is how do you specify in which
> transaction you wish to execute a particular command.
> 
> > connect;
> > begin trans1;
> > begin trans2;
> 
> > trans1: select * from tbl1;
> 
> Is this some kind of pseudocode, or are you saying that
> "trans1: select * from tbl1;"  is valid SQL syntax ?

No, pseudo-code, see Michaels mail for the real commands.

> > trans1: insert into tbl1(str) values ('Welcome');
> > trans2: select * from tbl1;
> > commit trans1;
> > trans2: select * from tbl1;
> > commit trans2;
> > disconnect;
> >
> > This code will never show the just inserted value 'welcome'. (Default
> > isolation-level)
> >
> > Since the insert that is done in transaction1, isn't visible for
> > transaction2.
> 
> Indeed, it's not visible.  Therefore: the same user can see that record
> in one place, and at the same time he doesn't see the record in another
> place. Is this truly a good thing ?

No. I would use one transaction for one user.
Or you can decide to use one transaction for each form, or one for each
thread. That's all up to the developer.

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to