Uploaded image for project: 'iBatis for .NET'
  1. iBatis for .NET
  2. IBATISNET-128

Multiple Thtreads cannot open separate connections/transactions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • DataMapper 1.2.1
    • DataMapper 1.3
    • DataMapper
    • None

    Description

      There was a bug like this fixed for the DataAccess component, but the problem is still in the DataMapper component.

      Inside the IBatisNet.DataMapper.SessionContainer.WindowSessionContainer class, the private variable _localSqlMapSession is decorated with the ThreadStatic attribute, but it is not declared as a static variable so the attibute is ignored.

      The DataMapper will only allow a single connection/transaction since there is only one _localSqlMapSession across all threads.

      Current Code:
      [ThreadStatic]
      private SqlMapSession _localSqlMapSession = null;
      Working Fix:
      [ThreadStatic]
      private static SqlMapSession _localSqlMapSession = null;

      Attachments

        Activity

          People

            gilles Gilles Bayon
            schallm Michael T. Schall
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: