Problem with commit of Transaction (using dotConnect 6 Beta)

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
mattlued
Posts: 1
Joined: Tue 19 Oct 2010 12:35

Problem with commit of Transaction (using dotConnect 6 Beta)

Post by mattlued » Tue 19 Oct 2010 12:52

Hi,

we're trying to commit some insert statements in a transaction to our database as described here http://www.devart.com/dotconnect/oracle ... tMode.html

we're using the dotConnect 6.0.10.0 Beta Version of devart.data.oracle and devart.data 5.0.110.0

I know, that the connection and everything else works, because we can read data, or manually commit the insert statements. But the Transaction.Commit() functions throws an error.

The Error-Message is:

Code: Select all

A first chance exception of type 'System.MissingMethodException' occurred in Devart.Data.Oracle.dll

System.MissingMethodException: Method not found: 'Void Devart.Common.DbMonitor.OnCommit(Devart.Common.DbMonitor, Devart.Common.MonitorTracePoint, System.Data.Common.DbConnection)'.
   at Devart.Data.Oracle.OracleMonitor.b(MonitorTracePoint A_0, OracleConnection A_1)
   at Devart.Data.Oracle.OracleTransaction.Commit()
   at WpfApplication2.MainWindow.RunOracleTransaction(String myConnString) in [...]\WpfApplication2\MainWindow.xaml.cs:line 66

The source code is basicly the one from the example. I only created or own connection String (which was created by my co-worker, but what can't really be the problem, cause anthing else works)

Source Code:

Code: Select all

using System;
using System.Windows;
using Devart.Data.Oracle;

namespace WpfApplication2
{
    /// 
    /// Interaction logic for MainWindow.xaml
    /// 
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            
            string temp = ";Persist Security Info=True";
            string _ip = "A.B.C.D";
            string _username = "user";
            string _password = "password";
            string _sid = "linux";
            string _name;
            string _direct = "True";
            string _provider = "";
            string _connection_lifetime = "0";
            string _max_pool = "100";
            string _min_pool = "0";
            string _Pooling = "True";
            string _Port = "1521";


            String connString = "User Id=" + _username + ";password=" + _password + ";Server=" + _ip + ";Port=" + _Port + ";Pooling=" + _Pooling + ";Min Pool Size=" + _min_pool + ";Max Pool Size=" + _max_pool + ";Connection Lifetime=" + _connection_lifetime + ";Direct=" + _direct + ";Sid=" + _sid + temp;


            RunOracleTransaction(connString);
        }


        public void RunOracleTransaction(string myConnString)
        {
            OracleConnection myConnection = new OracleConnection(myConnString);
            myConnection.Open();
            OracleCommand myCommand = new OracleCommand();
            OracleTransaction myTrans;
            // Start a local transaction 
            myTrans = myConnection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);
            // Assign transaction object for a pending local transaction 
            myCommand.Transaction = myTrans;
            myCommand.Connection = myConnection;
            try
            {
                myCommand.CommandText = "INSERT INTO sit_ellif (lieferant_liefnr) Values(1111)";
                myCommand.ExecuteNonQuery();
                myCommand.CommandText = "INSERT INTO sit_ellif (lieferant_liefnr,lieferant_suchtext) Values(2222, 'aaaaaa')";
                myCommand.ExecuteNonQuery();
                myTrans.Commit();
                Console.WriteLine("Both records are written to database.");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                Console.WriteLine("Neither record was written to database.");
            }
            finally
            {
                myConnection.Close();
            }
        } 
    }
}
One last thing: When I delete the "myTrans.Commit();" line - where it throws the exception - and replace it with

Code: Select all

myCommand.CommandText = "commit";
myCommand.ExecuteNonQuery();
the Insert works, but that souldn't be the way to go ... should it?

I hope anyone out there can help me with out problem.
Thanks!
- Matt

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Wed 20 Oct 2010 15:46

The issue appears to be caused by a problem with the dotConnect for Oracle installation. This may be, e.g., a policy assembly referencing to a newer version of Devart.Data.dll. To resolve the problem, please try performing the following:
- uninstall dotConnect for Oracle;
- clear the Program Files\Devart\dotConnect\ folder;
- delete the Devart.* and Devart.*.policy.* assemblies from the GAC;
- clear the Bin folder of your application;
- re-install dotConnect for Oracle.

Also, you can try the latest 5.70.180 version of dotConnect for Oracle. You can download it from
http://www.devart.com/dotconnect/oracle/download.html
(the trial version) or from Registered Users' Area (provided that you have an active subscription):
http://secure.devart.com/

We couldn't reproduce the problem with both Beta 6.0.1 and 5.70.180 versions in our environment. If the problem persists, could you please send us a complete test project (including the DDL script for the table used) with which it can be reproduced?

Post Reply