ExecuteNonQuery hangs for simple UPDATE

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
kfowler
Posts: 1
Joined: Fri 08 Jun 2012 14:49

ExecuteNonQuery hangs for simple UPDATE

Post by kfowler » Fri 08 Jun 2012 15:03

I am currently evaluating dotConnect for Oracle and have encountered the following problem.

I create an OracleCommand for an update and call ExecuteNonQuery and the call does not return. The command text is:

Code: Select all

UPDATE SystemUser SET LastLogin = TIMESTAMP '2012-06-08 15:55:24' WHERE ID = 1
I am using v7.0.6.0 of the Devart.Data.Oracle DLL, downloaded only days ago. Using Direct mode for the connection to the database. This update is performed correctly in the Oracle SQL Developer environment.

The call stack suggests a problem receiving a response from the database server, but other updates have worked without encountering this problem:

Code: Select all

[Managed to Native Transition]	
System.dll!System.Net.Sockets.Socket.Receive(byte[] buffer = {byte[4096]}, int offset = 0, int size, System.Net.Sockets.SocketFlags socketFlags = None, out System.Net.Sockets.SocketError errorCode = Success) + 0xc6 bytes	
System.dll!System.Net.Sockets.Socket.Receive(byte[] buffer, int offset, int size, System.Net.Sockets.SocketFlags socketFlags) + 0x20 bytes	
System.dll!System.Net.Sockets.NetworkStream.Read(byte[] buffer, int offset, int size) + 0x87 bytes	
Devart.Data.Oracle.dll!Devart.Data.Oracle.c2.a(byte[] A_0 = {byte[4096]}, int A_1 = 0, int A_2 = 8) + 0x89 bytes	
Devart.Data.Oracle.dll!Devart.Data.Oracle.c2.a(out byte A_0 = 0) + 0x38 bytes	
Devart.Data.Oracle.dll!Devart.Data.Oracle.cw.b(byte[] A_0 = {byte[1]}, int A_1 = 0, int A_2 = 1) + 0xd1 bytes	
Devart.Data.Oracle.dll!Devart.Data.Oracle.cw.f() + 0x56 bytes	
Devart.Data.Oracle.dll!Devart.Data.Oracle.bn.n() + 0x25 bytes	
Devart.Data.Oracle.dll!Devart.Data.Oracle.ar.c() + 0x106 bytes	
Devart.Data.Oracle.dll!Devart.Data.Oracle.ab.a(int A_0 = 1, Devart.Data.Oracle.bx A_1 = f) + 0xd00 bytes	
Devart.Data.Oracle.dll!Devart.Data.Oracle.OracleCommand.InternalExecute(System.Data.CommandBehavior behavior = Default, System.IDisposable disposable = {Devart.Data.Oracle.ab}, int startRecord = 0, int maxRecords = 0, bool nonQuery = true) + 0x790 bytes	
Devart.Data.dll!Devart.Common.DbCommandBase.ExecuteDbDataReader(System.Data.CommandBehavior behavior = Default, bool nonQuery = true) + 0x153 bytes	
Devart.Data.Oracle.dll!Devart.Data.Oracle.OracleCommand.ExecuteNonQuery() + 0x4c bytes	
DIPCOR00.dll!DIP.Security.Users.DiUser.UpdateLastLogin(int iUserID = 1, System.DateTime dtmLoginDateTime = {System.DateTime}, DIP.Data.DiDataWrapper dwConnection = {DIP.Data.DiOracleDataWrapper}) Line 3486 + 0x9 bytes

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: ExecuteNonQuery hangs for simple UPDATE

Post by Shalex » Tue 12 Jun 2012 14:19

We cannot reproduce the problem in our environment.
Could you please send us a small test project with the corresponding DDL/DML script? Also specify the exact version (xx.x.x.x) and capacity (x86 or x64) of your Oracle server. Give us your connection string (roughly, without credentials).

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: ExecuteNonQuery hangs for simple UPDATE

Post by Pinturiccio » Thu 14 Jun 2012 10:45

Thank you for the snippet of code. But we could not reproduce the issue.
kfowler wrote:In the context of the main application the UPDATE occurs in a background thread.
dotConnect for Oracle is not thread safe, so you should use a separate connection for the background thread or synchronize work with the thread yourself.

microsoftee
Posts: 1
Joined: Sun 08 Jul 2012 10:48
Location: Riyadh, Saudi Arabia
Contact:

Re: ExecuteNonQuery hangs for simple UPDATE

Post by microsoftee » Sun 08 Jul 2012 11:03

I was facing the same problem, it's not returning from ExecuteNonQuery.

I got it resolved by calling ExecuteNonQuery() again with "COMMIT" as CommandText, although Oracle says it's auto committing data changes but actually it is not. It commit automatically when you call the Connection.Close().

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: ExecuteNonQuery hangs for simple UPDATE

Post by Pinturiccio » Mon 09 Jul 2012 13:07

The OracleConnection class has the AutoCommit property. By default it equals True which means, that Commit is called for the current transaction after the execution of each SQL statement.
But when you use the transaction explicitly, then the AutoCommit property value is ignored. For more information, please refer to http://www.devart.com/dotconnect/oracle ... ommit.html

Post Reply