Question about the ADO.NET Oracle Provider

  • Thread starter Thread starter fabien.molinet
  • Start date Start date
F

fabien.molinet

Hi,
I have a question about the Microsoft ADO.Net Oracle Provider
Sometimes (only sometimes) I get exceptions like these :

-------------------------
Invalid operation. The connection is closed. : at
System.Data.OracleClient.OracleCommand.GetStatementHandle()
at
System.Data.OracleClient.OracleCommand.ExecuteScalarInternal(Boolean
needCLStype, Boolean needRowid, OciHandle& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteScalar()
at classAdo.TADOQuery.OpenScalar()
-------------------------
La référence d'objet n'est pas définie à une instance d'un objet. :
at System.Data.OracleClient.OciHandle.op_Implicit(OciHandle x)
at
System.Data.OracleClient.TracedNativeMethods.OCIDefineByPos(OciHandle
stmtp, IntPtr& hndlpp, OciHandle errhp, Int32 position, HandleRef
valuep, Int32 value_sz, DATATYPE dty, HandleRef indp, HandleRef rlenp,
HandleRef rcodep, MODE mode)
at System.Data.OracleClient.OracleColumn.Bind(OciHandle
statementHandle, NativeBuffer buffer, OciHandle errorHandle, Int32
rowBufferLength)
at
System.Data.OracleClient.OracleCommand.ExecuteScalarInternal(Boolean
needCLStype, Boolean needRowid, OciHandle& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteScalar()
at classAdo.TADOQuery.OpenScalar()


Do you think that a bug is hiding somewhere ?
- In ADO.NET ?
- In the Provider itself
- In my application ?

Thanks in advance !
 
Could we see le code?
It looks like the result of your ExecuteScalar did not return a result and
you're trying to reference the result when there is none. Peut-être ?


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

Hi,
I have a question about the Microsoft ADO.Net Oracle Provider
Sometimes (only sometimes) I get exceptions like these :

-------------------------
Invalid operation. The connection is closed. : at
System.Data.OracleClient.OracleCommand.GetStatementHandle()
at
System.Data.OracleClient.OracleCommand.ExecuteScalarInternal(Boolean
needCLStype, Boolean needRowid, OciHandle& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteScalar()
at classAdo.TADOQuery.OpenScalar()
-------------------------
La référence d'objet n'est pas définie à une instance d'un objet. :
at System.Data.OracleClient.OciHandle.op_Implicit(OciHandle x)
at
System.Data.OracleClient.TracedNativeMethods.OCIDefineByPos(OciHandle
stmtp, IntPtr& hndlpp, OciHandle errhp, Int32 position, HandleRef
valuep, Int32 value_sz, DATATYPE dty, HandleRef indp, HandleRef rlenp,
HandleRef rcodep, MODE mode)
at System.Data.OracleClient.OracleColumn.Bind(OciHandle
statementHandle, NativeBuffer buffer, OciHandle errorHandle, Int32
rowBufferLength)
at
System.Data.OracleClient.OracleCommand.ExecuteScalarInternal(Boolean
needCLStype, Boolean needRowid, OciHandle& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteScalar()
at classAdo.TADOQuery.OpenScalar()


Do you think that a bug is hiding somewhere ?
- In ADO.NET ?
- In the Provider itself
- In my application ?

Thanks in advance !
 
I don't think that it'll help you a lot, but here's some code :
Many things are missing since it's an object...
If you have any idea ? :)

function TADOQuery.OpenScalar : TField;
begin
try
SQL.Text := _remplacerGuillemets(SQL.Text); // appelle la méthode
de celui qui héritera
_command.CommandText := _lstSQL.Text;
_command.CommandText := TrimRight(_command.CommandText);

_gestionParametres;

if (not _ADOconnection.InTransaction) then
oBDD.Connecter('', '', false, false)
else
_command.Transaction := _ADOconnection._fbt;

if (oBDD.TypeBase=tbInterbase) then
_optimastionInterbaseStartingWith();

result := _getField('NomInconnu',_command.ExecuteScalar);

if (not _ADOconnection.InTransaction) then
oBDD.Deconnecter(false);
except
on E: Exception do
begin
TGlobal.s_AddSQLErrorToLog(E,SQLText);
raise E;
end;
end;
end;
 
Back
Top