[Mono-dev] Strange mono behaviour on Oracle

Daniel Morgan monodanmorg at yahoo.com
Thu Jun 29 16:20:58 EDT 2006


Hi,
 
It is best to reply to the list because private email can get lost, such as, spam filter.  I found your email in my spam folder.
 
I will look into it.


----- Original Message ----
From: APS <subscription.sapi at apsystems.it>
To: Daniel Morgan <monodanmorg at yahoo.com>
Sent: Thursday, June 22, 2006 12:56:12 PM
Subject: Re: [Mono-dev] Strange mono behaviour on Oracle

Sure, try this:

try{
         using (System.Data.OracleClient.OracleConnection Conn=new System.Data.OracleClient.OracleConnection("data source=yourtns;uid=youruid;pwd=youpwd")) {
                  Conn.Open();  
                  using(System.Data.OracleClient.OracleCommand Comm=Conn.CreateCommand()) {
                           Comm.CommandText="UPDATE TABLE SET DATEFIELD='12/13/2006'"; 
                           Comm.ExecuteNonQuery();  
                  }
         }
} catch {}

using (System.Data.OracleClient.OracleConnection Conn=new System.Data.OracleClient.OracleConnection("data source=yourtns;uid=youruid;pwd=youpwd")) {
         Conn.Open();
         using (System.Data.OracleClient.OracleTransaction Trans=Conn.BeginTransaction()) {    
                  using(System.Data.OracleClient.OracleCommand Comm=Conn.CreateCommand()) {
                           Comm.Transaction=Trans;  
                           Comm.CommandText="SELECT * FROM TABLE"; 
                           Comm.ExecuteReader();  
                  }
         }
}

In this example the first connection tries to update a table using a wrong date. the executenon query will raise an error that is catched. The second connection the opens a transaction and make a simple query on a table, the BeginTransaction will raise an error saying:

System.Data.OracleClient.OracleException: ORA-01453: SET TRANSACTION must be the first....

I tried it in Linux/Apache/Mono/Oracle Instant client/Oracle10 and Windows/Apache/Mono/Oracle Client 9.2/Oracle10 with the same effects.


At 18.22 22/06/2006, you wrote:

Can you provide a simple repeatable test case please?
 
----- Original Message ----
From: APS <subscription.sapi at apsystems.it>
To: mono-devel-list at lists.ximian.com
Sent: Thursday, June 22, 2006 4:31:52 AM
Subject: [Mono-dev] Strange mono behaviour on Oracle

Hi, it's a couple of days that I'm working on mono and Oracle comparing behaviours between mono and .Net
Now I've found this problem.
I make and oracle connection, create and oraclecommand and I launch and I launch an executenonquery. I this query fails the next transaction I create, within a new connection also fails with error 




System.Data.OracleClient.OracleException: ORA-01453: SET
TRANSACTION
deve essere la prima istruzione della transazione

in <0x000a6>
System.Data.OracleClient.Oci.OciTransactionHandle:Begin ()
in <0x00042>
System.Data.OracleClient.OracleConnection:BeginTransaction
(IsolationLevel il)
in <0x0000f>
System.Data.OracleClient.OracleConnection:BeginTransaction ()
in <0x0000a>
System.Data.OracleClient.OracleConnection:System.Data.IDbConnection.BeginTransaction
()


I tested it in linux with Oracle Instant Client and in windows with Oracle Client 9.2
It's possible that is always used a transaction that is not rolled back on errors?
Thanks in advance for help.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060629/151d8168/attachment.html 


More information about the Mono-devel-list mailing list