Users have been complaining about strange errors arising when using the OracleClient classes.
I have tracked it down to the OciDefineHandle and OciDefineByPos calls, and OracleParameter
handling of amanged objects by unmanaged code. Currently two of the parameters passed to the
above OCI call are short variables. They are passed as "ref" fields as Oracle uses their
address to put size and indicator data once the data is fetched. However, being defined as
short means that they are eligible for being moved during garbage collection. Thus if that
field is moved between the OciDefineByPos call and the fetch of the data then what Oracle is
pointing to may no longer be variable. I'm thinking it may be better to define these fields as
IntPtr and allocate them and retrieve their values via Marshal.ReadInt16. As for OracleParameter,
it uses a managed object "indicator" that is also used in a similar way. This reference is replaced
by a IntPtr and a get/set method to access the contents.
** Fixes#321718
* OciCalls.cs: Add stub for OCILobCharSetForm to get the charset
form associated with a CLOB/NCLOB.
* OciLobLocator.cs: Add Environment handle property that is
required to call OCILobCharSetForm and pass the output value to
OCILobRead.
* OciDefineHandler.cs: Update Environment property of
OCILobLocator.
svn path=/trunk/mcs/; revision=144980
* Test/TestOracleClient.cs: get oracle connected tests
going again
* System.Data.OracleClient.Oci/OciDefineHandle.cs
* System.Data.OracleClient/OracleDataReader.cs
* System.Data.OracleClient/OracleCommand.cs: fix character
field value for a reader that was retrieved from a REF CURSOR.
It was failing due to OCI_INVALID_HANDLE - resolve the error
by passing a connection object which has a valid environment
handle.
* System.Data.OracleClient.Oci/OciCalls.cs: correct
call to OCIDefineByPos
* System.Data.OracleClient/OracleParameter.cs: better way to
determine if the input value Is Null instead of using reflection.
Flush - Re-arraning how variables are being bound.
* System.Data.OracleClient/OciGlue.cs: add function
to convert OCI Return / Error Status Code to a String Description
* System.Data.OracleClient.Oci/OciErrorHandle.cs: better
error handling
svn path=/trunk/mcs/; revision=112419
* System.Data.OracleClient/OracleCommandBuilder.cs: update
based on changes Suresh did to OdbcCommandBuilder, SqlCommandBuilder,
and DbDataAdapter
* System.Data.OracleClient/OracleParameter.cs
* System.Data.OracleClient.Oci/OciHandle.cs
* System.Data.OracleClient.Oci/OciCalls.cs
* System.Data.OracleClient.Oci/OciDataType.cs
* System.Data.OracleClient.Oci/OciParameterDescriptor.cs
* System.Data.OracleClient.Oci/OciStatementHandle.cs
* System.Data.OracleClient.Oci/OciDefineHandle.cs: with help
from Hubert FONGARNAND <[email protected]>
implement TIMESTAMP support via OciDateTime descriptor
* System.Data.OracleClient.dll.sources: add
OciDateTimeDescriptor.cs to build
* System.Data.OracleClient.Oci/OciDateTimeDescriptor.cs: add new
file to support Oracle TIMESTAMP using OciDateTime descriptor
svn path=/trunk/mcs/; revision=48254
* System.Data.OracleClient/OracleDateTime.cs: modified -
added functions for converting the date format strings between
OracleDateTime and DateTime based on
the NLS_DATE_FORMAT on the Oracle server
* System.Data.OracleClient/OracleConnection.cs: implement
internal function GetNlsInfo to get NLS info from the Oracle server
for the session or environment. Also, implemented function
GetSessionNlsDateFormat to get Oracle's NLS_DATE_FORMAT string
* System.Data.OracleClient/OracleParameter.cs: for input parameters,
fixed setting the parameter value to DBNull.Value and fixed the
setting of a DateTime or OracleDateTime. Tried to fix CLOBs/BLOBs, but
it is still a TODO.
* Test/TestOracleClient.cs: updated the parameters test
* System.Data.OracleClient.Oci/OciHandle.cs: implement
internal function SetAttributeString
* System.Data.OracleClient.Oci/OciCalls.cs: add DllImport
OCIBindByNameBytes so byte array can be passed instead of IntPtr
for the value, add DllImport OCIDateTimeFromText,
and added DllImport for OCINlsGetInfo to get NLS info,
such as, NLS_DATE_FORMAT
* System.Data.OracleClient.Oci/OciAttributeType.cs: added
attribute for date format (not used)
* System.Data.OracleClient.Oci/OciNlsServiceType.cs: added new file
for an enum to hold NLS Service types which is to be used with GetNlsInfo()
in OracleConnection
* System.Data.OracleClient.dll.sources: added OciNlsServiceType.cs to
the build
svn path=/trunk/mcs/; revision=40926
* Assembly/AssemblyInfo.cs: updated copyright
* System.Data.OracleClient/OracleCommand.cs: add
connection string parameter "Server" and
removed "Database" to match .NET
* System.Data.OracleClient/OracleLob.cs: handle
BLOBs and CLOBs that are not null, but are empty
* System.Data.OracleClient/OracleCommand.cs: started
implementing Clone and ExecuteOracleScalar
* System.Data.OracleClient/OracleDataReader.cs: modified
- ms.net has GetDataTypeName return data types upper case
- implement GetFieldType
- implement GetOracleValues, GetOracleValue,
GetOracleDateTime, GetOracleNumber, GetOracleString
- modified GetOracleLob based on internal change
- fix GetSchemaTable to return the correct "DataType"
instead of always being System.String
- GetValue should return Blobs as a byte array and Clobs
as a string
- Test/TestOracleClient.cs: updated Mono Oracle Tests
- System.Data.OracleClient.Oci/OciCalls.cs: update
DllImports for data type, actual data size, and iters
* System.Data.OracleClient.Oci/OciDefineHandle.cs: modified
- added properties for precision and field type
- if ROWID is specified in a SELECT statement, handle
the data type of OciDataType.RowIdDescriptor by just
treating it as 10 byte string
- do not free a HGlobal handle for a LOB since they do
not get a HGlobal created for them
- GetValue should return an OracleLob for BLOBs and CLOBs
* System.Data.OracleClient.Oci/OciDataType.cs: make enum
OciDataType to be uint
* System.Data.OracleClient.Oci/OciParameterDescriptor.cs:
- add function to convert Oracle's data type name
to .net data type name
* System.Data.OracleClient.Oci/OciRowIdDescriptor.cs: flush
svn path=/trunk/mcs/; revision=38419
2004-01-26 Joerg Rosenkranz <[email protected]>
* System.Data.OracleClient.Oci/OciCalls.cs:
Changed binding of OciStmtPrepare from string
to byte [].
* System.Data.OracleClient.Oci/OciDefineHandle.cs:
Character types are converted using UTF8 encoding.
* System.Data.OracleClient.Oci/OciStatementHandle.cs:
SQL statement to be prepared is converted to byte
array using UTF8 encoding.
svn path=/trunk/mcs/; revision=22579
2004-01-09 Joerg Rosenkranz <[email protected]>
* System.Data.OracleClient.Oci/OciCalls.cs:
Added. It contains all external OCI calls which are
removed from all other files.
* System.Data.OracleClient/OciGlue.cs:
Fix for #52699 (OCI not thread safe).
* System.Data.OracleClient.Oci/OciHandle.cs:
Introduced special handling for Bind, Define and
Environment handles in FreeHandle. Revised the handling for
other types. Minor change in Dispose.
Replaced OCI calls.
* System.Data.OracleClient.Oci/OciDescriptorHandle.cs:
Special handling for Parameter handles in FreeHandle.
Replaced OCI calls.
* System.Data.OracleClient.Oci/OciDefineHandle.cs:
Character types are converted using the DefaultEncoding.
Replaced OCI calls.
* System.Data.OracleClient/OracleCommand.cs:
Dispose created OciStatementHandles.
* System.Data.OracleClient/OracleDataReader.cs:
Dispose used OciStatementHandle.
* System.Data.OracleClient/OracleTransaction.cs:
Dispose transaction handle.
* System.Data.OracleClient.Oci/OciStatementHandle.cs:
OCI_INVALID_HANDLE results in exception "Invalid handle."
Replaced OCI calls.
* System.Data.OracleClient.Oci/OciTransactionHandle.cs:
Introduced DetachFromServiceContext which is called in Commit
and Rollback (Fix for #52702).
* System.Data.OracleClient/OracleParameter.cs:
* System.Data.OracleClient.Oci/OciEnvironmentHandle.cs:
* System.Data.OracleClient.Oci/OciErrorHandle.cs:
* System.Data.OracleClient.Oci/OciLobLocator.cs:
* System.Data.OracleClient.Oci/OciServerHandle.cs:
* System.Data.OracleClient.Oci/OciServiceHandle.cs:
* System.Data.OracleClient.Oci/OciSessionHandle.cs:
Replaced OCI calls.
svn path=/trunk/mcs/; revision=21877