[DUG] Firebird connections / queries / transactions

Rohit Gupta rohit at cfl.co.nz
Thu Jul 28 11:37:03 NZST 2005


Phil,

I dont use TIB components.  I see that they have a transaction 
property but no ReadOnly property.  There are only four choices 
which is not enough.  The answer is I dont know.  IBO has Isolation 
and ReadOnly properties.  The transaction property wrt the Firebird 
actually has some 20 different options which IBO makes up from 
various exposed properties..

You will have to ask someone else.  I guess the following might 
reveal it.

Connect the table to a grid, execute a select statement.  change 
the property to readonly at runtime - if it rereads the data then it may
be doing the right thing.  But if it does not refetch the data then it is
not working correctly.  

I do remember reading that the concept of default transaction 
came from Borland... so I wouldnt use it.



Date sent:      	Thu, 28 Jul 2005 11:18:04 +1200
From:           	Phil Middlemiss <phil at tumonz.co.nz>
Organization:   	MTS Ltd
To:             	rohit at cfl.co.nz,
  	NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
Subject:        	Re: [DUG] Firebird connections / queries / transactions
Copies to:      	Send reply to:  	NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
	<mailto:delphi-request at ns3.123.co.nz?subject=unsubscribe>
	<mailto:delphi-request at ns3.123.co.nz?subject=subscribe>


So for TIBQuery and TIBSQL should I be doing anything when 
using select statements to ensure that the transaction is read only 
or is it only an issue when using tables? I don't know what you 
mean by "mark the transaction inside the query appropriately" since 
there are no properties for specifying a transaction as read only.

Phil.

Rohit Gupta wrote: 
A readonly table is RO for the end user but not as far as the Firebird 
is concerned.  It looks at the transaction type.  You can do a select 
with a normal default transaction that IBO or IBX or whatever put 
on.  This is what most people do when they start.  But this is not 
read only... it leaves the transaction open for edit/insert/delete.  

You need to mark the transaction inside the table/query 
appropriately.  I dont remember the official names as we always use 
subclassed components.  In these we make the table.readonly do 
the right thing.  We also rename the IBO's IB_Transaction to 
Transaction to make it more component neutral.  We also allocate a 
new transaction inside it if it has not been assigned by the 
programmer.  So that it never uses the default transaction.


Date sent:      Thu, 28 Jul 2005 10:48:08 +1200
From:           Phil Middlemiss <phil at tumonz.co.nz>
Organization:   MTS Ltd
To:             NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
Subject:        Re: [DUG] Firebird connections / queries / transactions
Send reply to:  NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
<mailto:delphi-request at ns3.123.co.nz?subject=unsubscribe>
<mailto:delphi-request at ns3.123.co.nz?subject=subscribe>

[ Double-click this line for list subscription options ] 

Thanks for the overview. By "read-only" transactions, are you referring 
to the SQL executed within a transaction? Your comment about the default 
transaction not being read-only has me puzzled - isn't it the table 
itself that is readonly?

Phil.

Rohit Gupta wrote:

  
Readonly transactions do not contribute to this problem.  Note that 
both the table/query and the transaction has to be readonly.  
WARNING - Do not use the default transaction as it is not readonly 
and was the cause of our problems.
 

    
_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi
Regards

Rohit

======================================================================
CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New Zealand
PH    (649) 489-2280 
FX    (649) 489-2290
email rohit at cfl.co.nz  or  r.gupta at xtra.co.nz
======================================================================


_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi



  Regards

Rohit

======================================================================
CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New Zealand
PH    (649) 489-2280 
FX    (649) 489-2290
email rohit at cfl.co.nz  or  r.gupta at xtra.co.nz
======================================================================




More information about the Delphi mailing list