BuildTpb() forgot too implement: IsolationLevel.Snapshot 
---------------------------------------------------------

                 Key: DNET-264
                 URL: http://tracker.firebirdsql.org/browse/DNET-264
             Project: .NET Data provider
          Issue Type: Improvement
            Reporter: Van den Wouwer Danny
            Assignee: Jiri Cincura


Hi Jiri,

The private method BuildTpb() inside FbTransaction.cs doesn't check the new 
IsolationLevel.Snapshot

  // Summary:
   //     Specifies the transaction locking behavior for the connection.
   public enum IsolationLevel
   {
       // Summary:
       //     A different isolation level than the one specified is being used, 
but the
       //     level cannot be determined.
       Unspecified = -1,
       //
       // Summary:
       //     The pending changes from more highly isolated transactions cannot 
be overwritten.
       Chaos = 16,
       //
       // Summary:
       //     A dirty read is possible, meaning that no shared locks are issued 
and no
       //     exclusive locks are honored.
       ReadUncommitted = 256,
       //
       // Summary:
       //     Shared locks are held while the data is being read to avoid dirty 
reads,
       //     but the data can be changed before the end of the transaction, 
resulting
       //     in non-repeatable reads or phantom data.
       ReadCommitted = 4096,
       //
       // Summary:
       //     Locks are placed on all data that is used in a query, preventing 
other users
       //     from updating the data. Prevents non-repeatable reads but phantom 
rows are
       //     still possible.
       RepeatableRead = 65536,
       //
       // Summary:
       //     A range lock is placed on the System.Data.DataSet, preventing 
other users
       //     from updating or inserting rows into the dataset until the 
transaction is
       //     complete.
       Serializable = 1048576,
       //
*        // Summary:
       //     Reduces blocking by storing a version of data that one 
application can read
       //     while another is modifying the same data. Indicates that from one 
transaction
       //     you cannot see changes made in other transactions, even if you 
requery.
       Snapshot = 16777216,
*    }

And it seems that on other places this IsolationLevel.Snapshot is already 
introduced (FbConnectionInternal.cs, FbConnectionString.cs, fbMetaData.xml)

So isn't it better to mimic this Isolation better then just taking the default 
now (ReadCommitted, NoRecversion):
Shouldn't it be mapped on  FbTransactionBehavior.Concurrency?

Like this:

       private TransactionParameterBuffer BuildTpb()
       {
           FbTransactionOptions options = new FbTransactionOptions();
           options.WaitTimeout = null;
           options.TransactionBehavior = FbTransactionBehavior.Write;

           options.TransactionBehavior |= FbTransactionBehavior.Wait;

           /* Isolation level */
           switch (this.isolationLevel)
           {
               case IsolationLevel.Serializable:
                   options.TransactionBehavior |= 
FbTransactionBehavior.Consistency;
                   break;

               case IsolationLevel.RepeatableRead:
*                case IsolationLevel.Snapshot:*
                   options.TransactionBehavior |= 
FbTransactionBehavior.Concurrency;
                   break;

               case IsolationLevel.ReadUncommitted:
                   options.TransactionBehavior |= 
FbTransactionBehavior.ReadCommitted;
                   options.TransactionBehavior |= 
FbTransactionBehavior.RecVersion;
                   break;

               case IsolationLevel.ReadCommitted:
               default:
                   options.TransactionBehavior |= 
FbTransactionBehavior.ReadCommitted;
                   options.TransactionBehavior |= 
FbTransactionBehavior.NoRecVersion;
                   break;
           }

           // just empty FbTransactionOptionsValues struct
           return this.BuildTpb(options);
       }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to