On Monday 27 March 2006 11:26, Michael Van Canneyt wrote:
> On Mon, 27 Mar 2006, johnf wrote:
> > On Monday 27 March 2006 09:52, Michael Van Canneyt wrote:
> > > On Mon, 27 Mar 2006, johnf wrote:
> > > > Hi,
> > > > My testing has shown me that for each select statement (i.e. Select *
> > > > from customer) I need to have a connection, transaction, and query
> > > > opened and active.  What this implies is for each select statement a
> > > > transaction must be opened (active:=true) and (the most important)
> > > > the connection will not accept any other requests until the
> > > > transaction is off (active:=false).  So it is not possible to share a
> > > > connection between two transactions (actually I'm concerned with the
> > > > query) because only one can be active at a time.
> > >
> > > This is not so by design. If it is so, then this is specific to the
> > > database you are using. For instance, for MySQL this would be so:  you
> > > can have only one transaction per connection. For Interbase, you can
> > > have multiple transactions per connection.
> > >
> > > > I have never had to deal with a connection accepting only one request
> > > > at a time (serial).
> > > >
> > > > So am I right?  I can not make a select request without turning on
> > > > the transaction.  In other words the connection is serial in nature?
> > >
> > > A select requires a transaction, this is for sure.
> > >
> > > > Hopefully, you can understand my confusion.  In the windows world I
> > > > never worried about if my requests were serial.   I normally open
> > > > several of the same form and each is making a request for data.  I
> > > > never had to worry about closing a transaction before opening the
> > > > second form.
> > >
> > > If you are using MySQL, then you need to use a single transaction for
> > > all forms, but you can have multiple queries at the same time.
> > > Committing your transaction will close all queries, though....
> > >
> > > Michael.
> >
> > Thanks it never occurred to me that it might be the Database engine. 
> > I'll check into the issue.  As I recall there is a setting in Postgres
> > that has to do with connections.
>
> Unfortunately, I have no postgres experience, so I cannot be of assistence
> there...
>
> Michael.
I did not find a setting that sets any connection parameters that would allow 
using the connection in a "overlapping" type of transaction or a nested set 
of begins.  I have written the Postgres list because I'm wondering if it is a 
limitation of Postgres or the way the FPC connection was writen.  It just 
seems that I have never run into this issue in any of my past connections to 
Postgres using different languages.  Of course it could still be the way I'm 
writting the code.  I'm still very new at this stuff. 

I'm working with my code to use a single transaction at this point.  But I'm 
still writing and have not tested yet.  I'll let you know soon.

Thanks

John

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

Reply via email to