Commit Graph
21 Commits
Author SHA1 Message Date
Neale Ferguson 3f740f3d94 Fixes 19752 -
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.
2014-09-12 11:25:57 -04:00
Neale Ferguson 0b26afc182 Fix memory leaks in Oracle Client. The largest leaks come from the cursors being created but never freed in OracleParameter.cs. The size of the memory used by these cursors varies from tens to thousands of bytes depending on the statement being executed. Several hours of transactions can lead to OOM errors. The other fixes are relatively minor but they do clean up other unmanaged memory not being returned. 2013-10-10 13:17:17 -04:00
Neale 66c4520fa2 Correct marshalling of size variables used in CharSetToUnicode (and vice-versa). They were specified as integers but for these calls they are, in C parlance, size_t so use SysUInt instead. 2013-04-16 22:48:58 -04:00
Daniel Morgan 147d957068 2009-11-19 Daniel Morgan <[email protected]>
* System.Data.OracleClient/OracleConnection.cs
	* System.Data.OracleClient/OciGlue.cs
	* System.Data.OracleClient.Oci/OciCalls.cs
	* System.Data.OracleClient.Oci/OciServiceHandle.cs
	* System.Data.OracleClient.Oci/OciSessionHandle.cs: add method
		OpenWithNewPassword to OracleConnection for
		Oracle.DataAccess

svn path=/trunk/mcs/; revision=146595
2009-11-20 05:03:02 +00:00
Veerapuram Varadhan 790b52755b 2009-10-29 Veerapuram Varadhan <[email protected]>
** 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
2009-10-29 02:02:12 +00:00
Joerg Rosenkranz 29a70ee7f9 2009-10-27 Joerg Rosenkranz <[email protected]>
* OciCalls.cs: Wrong function name in trace.

svn path=/trunk/mcs/; revision=144931
2009-10-28 08:36:34 +00:00
Veerapuram Varadhan d5d4cf26ee INTERVAL_DAY_TO_SECOND and INTERVAL_YEAR_TO_MONTH implementations
svn path=/trunk/mcs/; revision=130488
2009-03-29 03:47:56 +00:00
Veerapuram Varadhan 256eaefdb3 OciInterval implementation
svn path=/trunk/mcs/; revision=130487
2009-03-29 03:47:35 +00:00
Miguel de Icaza 8e07acf772 Multiple files:
Deals with the extension to Environment.OSVersion.Platform that might return a new
value MacOSX (6) on .NET
 

svn path=/trunk/mcs/; revision=121711
2008-12-17 17:56:25 +00:00
Daniel Morgan 61c5bd311b 2008-09-06 Daniel Morgan <[email protected]>
* 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
2008-09-06 09:45:42 +00:00
Leszek 'skolima' Ciesielski b537b2d2c7 Improved memory allocation time
svn path=/trunk/mcs/; revision=71321
2007-01-19 11:13:59 +00:00
Leszek 'skolima' Ciesielski bd7da4a3c1 Cleanup of unused variables and other compiler warnings.
svn path=/trunk/mcs/; revision=70505
2007-01-04 21:32:40 +00:00
Leszek 'skolima' Ciesielski d63b262fed Set svn:eol-style to native.
Added padding with 0's to buffers fed back to OCI.

svn path=/trunk/mcs/; revision=70467
2007-01-04 12:39:25 +00:00
Daniel Morgan 623727e08d REF CURSOR support. See ChangeLog for 2005-12-11 Daniel Morgan <[email protected]>
svn path=/trunk/mcs/; revision=54216
2005-12-11 22:38:21 +00:00
Daniel Morgan 8970063146 2005-08-10 Daniel Morgan <[email protected]>
* 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
2005-08-11 02:06:06 +00:00
Daniel Morgan be424fd23b 2005-02-20 Daniel Morgan <[email protected]>
* 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
2005-02-20 10:52:16 +00:00
Daniel Morgan d3c298e5e0 2005-01-09 Daniel Morgan <[email protected]>
* System.Data.OracleClient/OracleCommand.cs: set Command
	property on OciStatementHandle
	
	* System.Data.OracleClient/OracleConnection.cs: implement
	properties ServerVersion and DataSource, partially
	implement method ICloneable Clone, implement
	connection StateChange and InfoMessage events
	
	* System.Data.OracleClient/OciGlue.cs: add internal properties
	for OciSessionHandle and OciServerHandle
	
	* System.Data.OracleClient/OracleInfoMessageEventArgs.cs:
	implement
	
	* Test/TestOracleClient.cs: add new tests
	
	* System.Data.OracleClient.Oci/OciStatementHandle.cs: 
	- add property for OracleCommand
	- patch from Joost Evertse <[email protected]>
	  for handling OCI_SUCCES_WITH_INFO during Fetch which
	  indicates a Warning info message
	
	* System.Data.OracleClient.Oci/OciCalls.cs: added OCI call
	OCIServerVersion
	
	* System.Data.OracleClient.Oci/OciDefineHandle.cs: flush

svn path=/trunk/mcs/; revision=38585
2005-01-10 03:35:25 +00:00
Daniel Morgan bd13a44741 2005-01-06 Daniel Morgan <[email protected]>
* 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
2005-01-06 07:27:41 +00:00
Miguel de Icaza 7665cb70ff 2004-05-10 Joerg Rosenkranz <[email protected]>
* System.Data.OracleClient.Oci/OciCalls.cs:
		Added OCI calls OCICharSetToUnicode and OCIUnicodeToCharSet.
 	* System.Data.OracleClient.Oci/OciStatementHandle.cs:
 		Changed statement encoding from UTF8 to OCIUnicodeToCharSet.
 	* System.Data.OracleClient.Oci/OciDefineHandle.cs:
 		Changed string encoding from UTF8 to OCICharSetToUnicode.

svn path=/trunk/mcs/; revision=27855
2004-05-21 22:21:59 +00:00
Tim Coleman ed01c03f13 Patch submitted by Joerg Rosenkranz:
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-28 15:34:04 +00:00
Tim Coleman fe3197aa40 Submitted thanks to patch from Joerg Rosenkranz ...
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
2004-01-09 14:52:39 +00:00