I have two types of transactions, one for read, one for write:

-----------------------
Write transaction:

    FbConnection conn = new FbConnection(_connectionString);
    conn.Open();

    txn = conn.BeginTransaction(FbTransactionOptions.Concurrency);
    fbCommand.Transaction = txn;
    retval = fbCommand.ExecuteNonQuery();
    txn.Commit();

    conn.Close();
    conn.Dispose();


Question:
1. Does conn.Dispose() defeat the purpose of connection pool? Shall I just 
Close the connection but not Dispose?
2. When BeginTransaction, what's the FbTransactionOptions I shall use? Will 
FbTransactionOptions.Shared improve concurrency?

-----------------------
Read transaction. (No explicit transaction):

    FbConnection conn = new FbConnection(_connectionString);
    conn.Open();

    FbCommand fbCommand = conn.CreateCommand();
    fbCommand.CommandText = sqlCommand;

    // ... set fbCommand parameters

    FbDataAdapter dataAdapter = new FbDataAdapter(fbCommand);
    retval = dataAdapter.Fill(ds, dsTable);
    fbCommand.Dispose();

    conn.Close();
    conn.Dispose();

Question:
1. Shall I use transaction explicitly?

Thank you!
Sean

""Jiri Cincura"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On 6/6/07, Jiri Cincura <[EMAIL PROTECTED]> wrote:
>> On 6/6/07, Madhu Sasidhar, MD <[EMAIL PROTECTED]> wrote:
>> > Sean
>> > I had the same problem. Also, if you do not explicitly start and commit
>> > transactions, the gap between my Oldest Active and Next Transaction was
>> > growing (since the Server will commit/rolllback transactions only when 
>> > the
>>
>> Yes, make connections as short as possible. Using explicit
>> transactions can help.
>
> Not connections (but with connection pool too) but transactions, of 
> course.
>
>
> -- 
> Jiri {x2} Cincura
> http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
> 



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to