On Wed, 19 Apr 2006, Adrian Maier wrote:

On 4/19/06, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
On Wed, 19 Apr 2006, 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 ?

To allow several concurrent transactions.

Is this implemented inside the database engine, as some special SQL
commands ?

Yes.

SET TRANSACTION


Is it possible to start more transactions simultaneously
from firebird's interactive utility?

Yes.

how does one specify that a certain
SQL command has to be executed inside one transaction or another  ?

SELECT TRANSACTION NAME XYZ


Interbase/Firebird allows to start several concurrent transactions in
1 connection. AFAIK Oracle and MS-SQL too (named transactions).

I'm not sure about this.
Oracle has named transactions, but those are just labels that are given
to long-running transaction - so that they can be easier identified. Also,
in Oracle it is possible that a stored procedure be executed in an
'autonomous' transaction ( i've used this once for writing a procedure
that wrote debugging information to a table ; in case of error the messages
would have been rolled back unless they were inserted by an autonomous
transaction).  But i believe that these autonomous transactions are a different
beast from the feature we are talking about.

Probably it's a restricted form. Like I said, I'm not sure about oracle
and MS-SQL...




This is extremely handy.

I understand this.
Yet,  my feeling is that this feature is an interbase/firebird
extension , and that
it would be possible to achieve the same by using more standard features like
cursors and savepoints.

Interbase has those too, but you can't do what I need with that:
In a server app, have 1 connection and several independent transactions
within that connection.

You must take into account that most commercial engines require a per-user
license, so connections are 'expensive'. 1 connection with separate
transactions solves this problem. There is 1 connection, but each user
is in a separate transaction...

Michael.

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

Reply via email to