Subject | Re: [firebird-support] Other doubts with transactions |
---|---|
Author | Martijn Tonies |
Post date | 2004-05-11T09:51:49Z |
Hi,
data without having an actual cursor open on the server. If not,
then yes, committing will close the cursor.
default transaction, then when does the default transaction
gets committed?
On the other hand, a read-only, read-committed transaction (I
believe) doesn't matter when it comes to stuck transaction counters.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> I'm still experimenting with Firebird in the hope that sooner or laterIf you don't, the component set you're using will do this for you.
> I will not need to ask questions any more :-)
>
> My current practice is to use an explicit transaction only when I make
> changes to a table, but I often see that people here speak of
> transactions also for simple select's. Now this is what I do:
>
> 1. Open a table with, for example, a simple 'select * from table'
> 2. start a transaction if I have to modify it
> 3. commit or rollback (hard)
>
> As you can see, I never start a transaction when I simply open the
> query for browsing. Then my questions are:
>
> 1. Do I have to start a transaction also for opening the query?
> 2. If yes, can I start it before the query is open?Indeed, you should.
> 3. If yes again, a commit or rollback will commit or rollback theThat depends. If you have a caching component, you can view
> query opening as well, so I have to open it again, right?
data without having an actual cursor open on the server. If not,
then yes, committing will close the cursor.
> 4. Do I really need all this, or is the default transaction of theWell, that depends. If you have multiple cursors all using the
> connection taking care of the query opening letting me play with my
> explicit transaction only during changes not worrying of opening?
default transaction, then when does the default transaction
gets committed?
On the other hand, a read-only, read-committed transaction (I
believe) doesn't matter when it comes to stuck transaction counters.
> 5. If yes for 4., closing the query will commit (or rollback?) theThat depends on your component set and settings.
> default transaction as well, right?
> 6. Are there any special cases when I DO have to explicitly start aSee all of the above.
> transaction for a simple query open for browse (no edit)?
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com