On Wed, 2006-04-19 at 10:22 +0300, Adrian Maier wrote:
> On 4/19/06, Joost van der Sluis <[EMAIL PROTECTED]> wrote:
> > > Is this a problem with PostrgreSQL itself or the component in lazarus
> > > wrapping it?
> >
> > It's a problem of postgres. A transaction 'block' is started with the
> > sql-command 'begin', from that comand on, all queries are executed
> > within that transaction. Using another connection is not possible.
> > Unless, offcourse, you start a new connection. Or closes the transaction
> > (commit, rollback etc)
> 
> Please pardon me for jumping in the middle of the thread, but your
> phrase made me really curious.   The behaviour you described seems
> to be the normal one, once you execute "begin" (transaction) . What
> other behaviour would someone expect postgres to have ?

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:

connect;
begin trans1;
begin trans2;
trans1: select * from tbl1;
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.

Postgres doesn't support multiple transactions in one connection. So you
have to use two connections. But further it's the same.

JoJo,
  Joost.

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

Reply via email to