Hi !

I would like to use FbBatchExecution inside TransactionScope to rollback
test datas after each unit test, but i have the following exception :
"System.InvalidOperationException : A transaction is currently active.
Parallel transactions are not supported."

Can we specify to FbBatchExecution to use the ambiant transaction ?


Code (or url with project, db, script : http://www.box.net/shared/4mr601knvt) :
--------------------------
    Sub Main()

        Dim localPath As String = "R:\FbTransactionScope"

        Dim script As FirebirdSql.Data.Isql.FbScript
        Dim batch As FirebirdSql.Data.Isql.FbBatchExecution

        Using trs As TransactionScope = New TransactionScope()

            'Create a new connection (enlist=true)
            Dim conn As FbConnection = New
FbConnection("User=SYSDBA;Password=masterkey;Database=" & localPath &
"\database\test.fdb;DataSource=localhost;Port=3051;Dialect=3;Charset=UTF8;Role=;Connection
lifetime=15;Enlist=True;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet
Size=8192;ServerType=0;")
            conn.Open()

            'Open and execute script
            script = New FirebirdSql.Data.Isql.FbScript(localPath &
"\script\insertaccounts.sql")
            script.Parse()
            batch = New FirebirdSql.Data.Isql.FbBatchExecution(conn, script)
            batch.Execute()

            'Commit
            trs.Complete()

            'close connection
            conn.Close()
            conn.Dispose()

        End Using
    End Sub



Versions used :
---------------------
Firebird 2.1
Dot net provider 2.5.0.0 beta 1
Framework 2.0


Thanks for your help !
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to