From VisualWorks®, 7.6 of February 8, 2008 on March 3, 2008 at 9:41:11 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>OracleDatabaseException</name> <environment>Database</environment> <super>Database.ExternalDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleDatabaseException
OracleDatabaseException is raised in case of the Oracle database errors.
</comment> <class> <name>OracleDatabaseResumableException</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleDatabaseResumableException
OracleDatabaseResumableException is raised in case of the Oracle database resumable exception.
</comment> <class> <name>SuccessWithInformation</name> <environment>Database</environment> <super>Database.OracleDatabaseResumableException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.SuccessWithInformation
SuccessWithInformation is used to indicate that the action is success, but there is a warning.
</comment> <class> <name>OracleInterface</name> <environment>Database</environment> <super>External.ExternalInterface</super> <private>false</private> none encoding <imports> private Database.OracleInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles></libraryFiles> <libraryDirectories></libraryDirectories> true full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleInterface
This class defines calling conventions for the Oracle OCI. Instance Variables: encoding <Symbol> A symbol remembers the encoding selection.
</comment> <class> <name>OracleSolarisInterface</name> <environment>Database</environment> <super>Database.OracleInterface</super> <private>false</private> none <imports> private Database.OracleSolarisInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libclntsh.so</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleSolarisInterface
This class defines calling conventions for the Oracle OCI on the Solaris platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>Oracle64BitInterface</name> <environment>Database</environment> <super>Database.OracleInterface</super> <private>false</private> none <imports> private Database.Oracle64BitInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.Oracle64BitInterface
This class defines 64-bit calling conventions for the Oracle OCI. It should only be used in 64-bit images, running on a 64-bit VM. The 64-bit VM regards "long int" as a 64-bit integer, but the Oracle libraries are faithful to the original spec, which uses 32-bit integers. Thus, a few changes were made to the 64-bit classes, almost entirely directed at changing the word "long int" to "int", which is seen by the 64-bit VM as a 32-bit integer.
</comment> <class> <name>UnableToRetrieveDescriptorInfo</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToRetrieveDescriptorInfo
UnableToRetrieveDescriptorInfo is used to indicate that the information of a descriptor could not be retrieved.
</comment> <class> <name>OracleBuffer</name> <environment>Database</environment> <super>Database.ExternalDatabaseBuffer</super> <private>false</private> none indicatorsPointer lengthsPointer rcodesPointer cursizPointer getSelector setSelector nullsPossible tempArray session <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleBuffer
OracleBuffer is a private subclass, and extends ExternalDatabaseBuffer to deal with Oracle. Intimate details are shared with OracleSession. All CPointers managed by OracleBuffer are assumed to not be automatically garbage collectable. Clients are responsible for explicitly freeing the space. Instance variables: indicatorsPointer <CPointer> Pointer to vector of indicators. rcodesPointer <CPointer> Pointer to vector of return codes. lengthsPointer <CPointer> Pointer to vector of item lengths. cursizPointer <nil | CPointer> Pointer to the current length of the array. If scalar, holds nil. getSelector <nil | Symbol> Selector to perform to get values out of the buffer. setSelector <nil | Symbol> Selector to perform to put values into the buffer. nullsPossible <Boolean> true => the column allows nulls tempArray <ByteArray> A ByteArray used to hold DATE and VARNUM data while processing. session <OracleSession> The session in which the OracleBuffer is used. Class variables: GetSelectorMap <IdentityDictionary> Maps from internalType to a data conversion selector.
</comment> <class> <name>OracleSolaris64Interface</name> <environment>Database</environment> <super>Database.Oracle64BitInterface</super> <private>false</private> none <imports> private Database.OracleSolaris64InterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libclntsh.so.10.1</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleSolaris64Interface
This class defines calling conventions for the Oracle OCI on the 64-bit Solaris platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>UnableToGetLobLength</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToGetLobLength
UnableToGetLobLength is used to indicate that it is unable to get the length of a lob.
</comment> <class> <name>OracleHPUXInterface</name> <environment>Database</environment> <super>Database.OracleInterface</super> <private>false</private> none <imports> private Database.OracleHPUXInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libclntsh.sl</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleHPUXInterface
This class defines calling conventions for the Oracle OCI on the HPUX platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>OracleSession</name> <environment>Database</environment> <super>Database.ExternalDatabaseSession</super> <private>false</private> none resultsCache hstmtHolder herrHolder bindValuePointersHolder maxLongBytes queryIsPLSQL currentRowIndex totalRows rowsInBlock dependentLobs sqlPointerHolder maxBindSize needBinding answerLobProxy defaultDisplayLobSize <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleSession
OracleSession is the concrete implementation of session services using the Oracle OCI library. Instance Variables: resultsCache <SmallInteger> A private cache of the function value. Used to tell resultsExternal the outcome of the operation. hstmtHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the pointer for the current OCI statement handle, if any. The value holder is shared with the executor object. herrHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the pointer for the current OCI error handle, if any. The value holder is shared with the executor object. bindValuePointersHolder <ValueHolder on: ((IdentityDictionary of: OracleBuffer) | nil)> Holds the OracleBuffers used to reference externally bound parameter values maxLongBytes <SmallInteger> LONG and LONG RAW fields may be up to 65535 bytes long. Since not all applications will use data of this length, an interface is provided to reduce the amount of memory required to buffer fields of these types. queryIsPLSQL <Boolean> Indicates that whether the prepared query is an anonymous PL/SQL block. currentRowIndex <SmallInteger> Part of the support for utilizing the array interface for fetching rows. totalRows <SmallInteger> Part of the support for utilizing the array interface for fetching rows. rowsInBlock <SmallInteger> Part of the support for utilizing the array interface for fetching rows. dependentLobs <Bag> LOBs depending on the current session. sqlPointerHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the pointer for the current sql, if any. The value holder is shared with the executor object. maxBindSize <SmallInteger> Length of the buffer needed for binding arrays (the size of the longest array to be binded). needBinding <Boolean> A boolean indicating whether binding is needed for the query it is processing. answerLobProxy <Boolean> true => the LOBs are returned as LOB proxies. false => the LOBs are returned as values. defaultDisplayLobSize <Integer> A default value defining the length of the LOB to be retrieved. It can be reset to reflect the LOB length desired. Shared Variables: InternalDatatypeToClassMap <ClassOfVariable> description of variable''s function RegisteredOracleSessions <ClassOfVariable> description of variable''s function
</comment> <class> <name>UnableToTrimLobData</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToTrimLobData
UnableToTrimLobData is used to indicate that the data of a lob could not be trimmed.
</comment> <class> <name>OracleTimestampBuffer</name> <environment>Database</environment> <super>Database.OracleBuffer</super> <private>false</private> none yearPointer monthPointer dayPointer hourPointer minPointer secPointer fsecPointer pointerInitialized <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleTimestampBuffer
OracleTimestampBuffer extends OracleBuffer to deal with Timestamp data types in Oracle. Instance Variables: yearPointer <CPointer | nil> A private pointer used to hold the year information in the conversion process. monthPointer <CPointer | nil> A private pointer used to hold the month information in the conversion process. dayPointer <CPointer | nil> A private pointer used to hold the day information in the conversion process. hourPointer <CPointer | nil> A private pointer used to hold the hour information in the conversion process. minPointer <CPointer | nil> A private pointer used to hold the minute information in the conversion process. secPointer <CPointer | nil> A private pointer used to hold the second information in the conversion process. fsecPointer <CPointer | nil> A private pointer used to hold the fractional second information in the conversion process. pointerInitialized <Boolean> A boolean indicating whether the pointers are initialized.
</comment> <class> <name>UnableToReleaseExternalResource</name> <environment>Database</environment> <super>Database.OracleDatabaseResumableException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToReleaseExternalResource
UnableToReleaseExternalResource is used to indicate that an external resource lob could not be released.
</comment> <class> <name>OracleLargeObjectBuffer</name> <environment>Database</environment> <super>Database.OracleBuffer</super> <private>false</private> none lobLocatorHolder <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleLargeObjectBuffer
OracleLargeObjectBuffer extends OracleBuffer to deal with CLOB, BLOB and BFILE data types in Oracle. Instance Variables: lobLocatorHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the locator for the LOB.
</comment> <class> <name>UnsupportedTransactionMode</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnsupportedTransactionMode
UnsupportedTransactionMode is used to indicate that an attempt was made to set an unsupported transaction mode.
</comment> <class> <name>UnableToDescribeSchemaObject</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToDescribeSchemaObject
UnableToDescribeSchemaObject is used to indicate that it is unable to describe schema object.
</comment> <class> <name>OracleTransaction</name> <environment>Database</environment> <super>Database.ExternalDatabaseTransaction</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleTransaction
Class OracleTransaction is the concrete implementation of the transaction concept for the Database Connect for Oracle.
</comment> <class> <name>OracleLobProxy</name> <environment>Database</environment> <super>Database.OracleLargeObjectBuffer</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleLobProxy
OracleLobProxy extends OracleLargeObjectBuffer to deal with CLOB, BLOB and BFILE data types in Oracle. It is associated with relevant LOB methods.
</comment> <class> <name>OracleAIXInterface</name> <environment>Database</environment> <super>Database.OracleInterface</super> <private>false</private> none <imports> private Database.OracleAIXInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libclntsh.a(shr.o)</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleAIXInterface
This class defines calling conventions for the Oracle OCI on the AIX platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>UnableToConstructTimestamp</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToConstructTimestamp
UnableToConstructTimestamp is used to indicate that it is unable to construct a Timestamp.
</comment> <class> <name>UnableToLockObjectReference</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToLockObjectReference
UnableToLockObjectReference is used to indicate that an object reference could not be locked.
</comment> <class> <name>UnableToUnlockObjectReference</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToUnlockObjectReference
UnableToUnlockObjectReference is used to indicate that an object reference could not be unlocked.
</comment> <class> <name>OracleNTInterface</name> <environment>Database</environment> <super>Database.OracleInterface</super> <private>false</private> none <imports> private Database.OracleNTInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>oci.dll</item> <item>advapi32.dll</item></libraryFiles> <libraryDirectories></libraryDirectories> true full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleNTInterface
This class defines calling conventions for the Oracle OCI on the Windows NT (Intel) platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>InvalidAttributeType</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.InvalidAttributeType
InvalidAttributeType is used to indicate invalid attribute type.
</comment> <class> <name>UnableToAllocateDescriptor</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToAllocateDescriptor
UnableToAllocateDescriptor is used to indicate that an attempt to allocate descriptor failed..
</comment> <class> <name>OracleColumnDescription</name> <environment>Database</environment> <super>Database.ExternalDatabaseColumnDescription</super> <private>false</private> none dbsize internalType tableOwner tableName <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleColumnDescription
The OracleColumnDescription adds information to ExternalDatabaseColumnDescription which is unique to Oracle. Instance Variables: dbsize <SmallInteger | nil> Maximum size of column as stored in the Oracle data dictionary, if known. Use and definition subject to change as needed to support the OCI. internalType <SmallInteger | nil> Internal datatype code, if known. Use and definition subject to change as needed to support the OCI. tableOwner <String | nil> Obsolete. Exists solely to support a backward compatibility feature. tableName <String | nil> Obsolete. Exists solely to support a backward compatibility feature.
</comment> <class> <name>UnableToInitializeInterfaceLibrary</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToInitializeInterfaceLibrary
UnableToInitializeInterfaceLibrary is used to indicate that the interface library could not be initialized.
</comment> <class> <name>UnableToGetTimestampTime</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToGetTimestampTime
UnableToGetTimestampTime is used to indicate that it is unable to get the time part of a Timestamp.
</comment> <class> <name>UnableToModifyObjectInfo</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToModifyObjectInfo
UnableToModifyObjectInfo is used to indicate that an object information could not be modified.
</comment> <class> <name>UnableToAllocateResourceHandle</name> <environment>Database</environment> <super>Database.OracleDatabaseResumableException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToAllocateResourceHandle
UnableToAllocateResourceHandle is used to indicate that a handle could not be allocated.
</comment> <class> <name>UnableToGetTimestampDate</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToGetTimestampDate
UnableToGetTimestampDate is used to indicate that it is unable to get the date part of a Timestamp.
</comment> <class> <name>UnableToFreeDescriptor</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToFreeDescriptor
UnableToFreeDescriptor is used to indicate that a descriptor could noe be freed.
</comment> <class> <name>OracleLinux64Interface</name> <environment>Database</environment> <super>Database.Oracle64BitInterface</super> <private>false</private> none <imports> private Database.OracleLinux64InterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libclntsh.so.10.1</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleLinux64Interface
This class defines calling conventions for the Oracle OCI on the 64-bit Linux platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>InconsistentDataTypesInArrayBinding</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.InconsistentDataTypesInArrayBinding
InconsistentDataTypesInArrayBinding is used to indicate inconsistent data types when using array binding.
</comment> <class> <name>OracleOS2Interface</name> <environment>Database</environment> <super>Database.OracleInterface</super> <private>false</private> none <imports> private Database.OracleOS2InterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>ora7o32</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleOS2Interface
This class defines calling conventions for the Oracle OCI on the OS/2 platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>UnableToInitializeEnvironmentHandle</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToInitializeEnvironmentHandle
UnableToInitializeEnvironmentHandle is used to indicate that a environment handle could not be initialized.
</comment> <class> <name>UnableToAssignLobLocator</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToAssignLobLocator
UnableToAssignLobLocator is used to indicate that a lob locator could not be assigned.
</comment> <class> <name>OracleWin95Interface</name> <environment>Database</environment> <super>Database.OracleNTInterface</super> <private>false</private> none <imports> Database.OracleWin95InterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>oci.dll</item> <item>advapi32.dll</item> <item>oci.dll</item> <item>advapi32.dll</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleWin95Interface
This class defines calling conventions for the Personal Oracle OCI on the Windows 95 (Intel) platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>OracleConnection</name> <environment>Database</environment> <super>Database.ExternalDatabaseConnection</super> <private>false</private> none henvHolder herrHolder hsvcctxHolder hsrvrHolder hsessHolder htxnHolder executionMode transactionMode authenticationMode signalMap libraryInitialized <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleConnection
OracleConnection is the concrete class implementation of connection services using the Oracle OCI library. Instance Variables: henvHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the pointer for the current OCI environment handle, if any. The value holder is shared with the executor object. herrHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the pointer for the current OCI error handle, if any. The value holder is shared with the executor object. hsvcctxHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the pointer for the current OCI service context handle, if any. The value holder is shared with the executor object. hsrvrHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the pointer for the current OCI server handle, if any. The value holder is shared with the executor object. hsessHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the pointer for the current OCI user session handle, if any. The value holder is shared with the executor object. htxnHolder <ValueHolder on: (CPointer | nil)> A private value holder which remembers the pointer for the current OCI transaction handle, if any. The value holder is shared with the executor object. executionMode <CMacroDefinition> An integer which remembers the execution mode. transactionMode <ByteSymbol> A symbol which indicates the transaction mode. authenticationMode <CMacroDefinition> An integer which remembers the authentication mode. Class instance variables: signalMap <IdentityDictionary> Maps a set of error codes to their corresponding signals. libraryInitialized <Boolean> A boolean indicating whether the Oracle OCI library is initialized. Shared Variables: AttributeTypeConversionMap <IdentityDictionary> Maps OCI Environment Handle Attributes to Smalltalk data values. EncoderMap <Dictionary> Maps character encoding names to the StreamEncoder names used in Smalltalk. RegisteredOracleConnections <HandleRegistry> A private registry of all active OracleConnection instances. An active connection either currently holds an hda and lda pair or is paused and is ready to again hold such resources.
</comment> <class> <name>OracleMacOSXInterface</name> <environment>Database</environment> <super>Database.OracleInterface</super> <private>false</private> none <imports> private Database.OracleMacOSXInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libclntsh.dylib</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleMacOSXInterface
This class defines calling conventions for the Oracle OCI on the MacOSX platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>UnableToWriteLobData</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToWriteLobData
UnableToWriteLobData is used to indicate that data could not be written into a lob.
</comment> <class> <name>UnableToReadLobData</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToReadLobData
UnableToReadLobData is used to indicate that the data of a lob could not be read.
</comment> <class> <name>UnableToAllocateResource</name> <environment>Database</environment> <super>Database.OracleDatabaseResumableException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToAllocateResource
UnableToAllocateResource is used to indicate that a resource could not be allocated.
</comment> <class> <name>OracleError</name> <environment>Database</environment> <super>Database.ExternalDatabaseError</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleError
Class OracleError adds information about the error returned from the OCI interface. Refer to the Oracle documentation for further details.
</comment> <class> <name>OracleLinuxInterface</name> <environment>Database</environment> <super>Database.OracleInterface</super> <private>false</private> none <imports> private Database.OracleLinuxInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libclntsh.so</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleLinuxInterface
This class defines calling conventions for the Oracle OCI on the Linux (Intel) platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <class> <name>UnableToGetLobChunkSize</name> <environment>Database</environment> <super>Database.OracleDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <comment> Database.UnableToGetLobChunkSize
UnableToGetLobChunkSize is used to indicate that it is unable to get the chunk size of a lob locator.
</comment> <class> <name>OracleAlphaUnixInterface</name> <environment>Database</environment> <super>Database.OracleInterface</super> <private>false</private> none <imports> private Database.OracleAlphaUnixInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libclntsh.so</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OracleEXDI</package> </attributes> </class> <comment> Database.OracleAlphaUnixInterface
This class defines calling conventions for the Oracle OCI on the Alpha platform. Please refer to the environment variable on your machine for the path containing necessary Oracle library files.
</comment> <name>RegisteredOracleConnections</name> <environment>Database.OracleConnection</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>AttributeTypeConversionMap</name> <environment>Database.OracleConnection</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>EncoderMap</name> <environment>Database.OracleConnection</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>RegisteredOracleSessions</name> <environment>Database.OracleSession</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>InternalDatatypeToClassMap</name> <environment>Database.OracleSession</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>SetSelectorMap</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>DefaultFloatPointerType</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>Unsigned32BitIntType</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>DefaultLongPointerType</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>DefaultDoublePointerType</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>Signed32BitIntType</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>GetSelectorMap</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>DefaultShortPointerType</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>DefaultUnsignedCharPointerType</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <name>DefaultUnsignedShortPointerType</name> <environment>Database.OracleBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>OracleEXDI</package> </attributes> <methods> Database.OracleDatabaseResumableException class <category>testing</category>
mayResume ^true
</methods> <methods> Database.OracleInterface <category>structs</category>
__OCIBind <C: struct __OCIBind>
__OCIDateTime <C: struct __OCIDateTime>
__OCIDefine <C: struct __OCIDefine>
__OCIDescribe <C: struct __OCIDescribe>
__OCIEnv <C: struct __OCIEnv>
__OCIError <C: struct __OCIError>
__OCILobLocator <C: struct __OCILobLocator>
__OCIParam <C: struct __OCIParam>
__OCIServer <C: struct __OCIServer>
__OCISession <C: struct __OCISession>
__OCISnapshot <C: struct __OCISnapshot>
__OCIStmt <C: struct __OCIStmt>
__OCISvcCtx <C: struct __OCISvcCtx>
__OCITrans <C: struct __OCITrans>
</methods> <methods> Database.OracleInterface <category>types</category>
dvoid <C: typedef void * dvoid>
OCIBind <C: typedef struct __OCIBind OCIBind>
OCIDateTime <C: typedef struct __OCIDateTime OCIDateTime>
OCIDefine <C: typedef struct __OCIDefine OCIDefine>
OCIDescribe <C: typedef struct __OCIDescribe OCIDescribe>
OCIEnv <C: typedef struct __OCIEnv OCIEnv>
OCIError <C: typedef struct __OCIError OCIError>
OCILobLength <C: typedef ubig_ora OCILobLength>
OCILobLocator <C: typedef struct __OCILobLocator OCILobLocator>
OCILobMode <C: typedef enum __OCILobMode OCILobMode>
OCILobOffset <C: typedef ubig_ora OCILobOffset>
OCIParam <C: typedef struct __OCIParam OCIParam>
OCIServer <C: typedef struct __OCIServer OCIServer>
OCISession <C: typedef struct __OCISession OCISession>
OCISnapshot <C: typedef struct __OCISnapshot OCISnapshot>
OCIStmt <C: typedef struct __OCIStmt OCIStmt>
OCISvcCtx <C: typedef struct __OCISvcCtx OCISvcCtx>
OCITrans <C: typedef struct __OCITrans OCITrans>
OraText <C: typedef unsigned char OraText>
oratext <C: typedef void * oratext>
sb1 <C: typedef signed char sb1>
sb2 <C: typedef signed short sb2>
sb4 <C: typedef signed long sb4>
size_t <C: typedef unsigned int size_t>
sword <C: typedef signed int sword>
text <C: typedef unsigned char text>
ub1 <C: typedef unsigned char ub1>
ub2 <C: typedef unsigned short ub2>
ub4 <C: typedef unsigned long ub4>
ubig_ora <C: typedef void * ubig_ora>
uword <C: typedef unsigned int uword>
</methods> <methods> Database.OracleInterface <category>accessing</category>
copyToHeapSelector ^#copyToHeap
encoding ^encoding
encoding: anEncoding encoding := anEncoding
getEncoding | str subStr | str := self getOracleParameterString: 'NLS_LANG'. subStr := str copyFrom: (str indexOf: $.) + 1 to: str size. (subStr isEmpty or: [subStr = 'NA']) ifTrue: [^#default]. ^OracleConnection mapEncodings at: subStr ifAbsent: [self error: (#errColumnEncoding << #oracleDB >> 'Column encoding not yet recognized')]
mallocSelector ^#malloc:
</methods> <methods> Database.OracleInterface <category>defines</category>
OCI_ATTR_ALLOC_DURATION <C: #define OCI_ATTR_ALLOC_DURATION 37 >
OCI_ATTR_CACHE_MAX_SIZE <C: #define OCI_ATTR_CACHE_MAX_SIZE 35 >
OCI_ATTR_CACHE_OPT_SIZE <C: #define OCI_ATTR_CACHE_OPT_SIZE 34 >
OCI_ATTR_CHARSET_FORM <C: #define OCI_ATTR_CHARSET_FORM 32 >
OCI_ATTR_CHARSET_ID <C: #define OCI_ATTR_CHARSET_ID 31 >
OCI_ATTR_COLLECTION_ELEMENT <C: #define OCI_ATTR_COLLECTION_ELEMENT 227 >
OCI_ATTR_COLLECTION_TYPECODE <C: #define OCI_ATTR_COLLECTION_TYPECODE 217 >
OCI_ATTR_DATA_SIZE <C: #define OCI_ATTR_DATA_SIZE 1 >
OCI_ATTR_DATA_TYPE <C: #define OCI_ATTR_DATA_TYPE 2 >
OCI_ATTR_ENV <C: #define OCI_ATTR_ENV 5 >
OCI_ATTR_FUNCODE <C: #define OCI_ATTR_FUNCODE OCI_ATTR_FNCODE >
OCI_ATTR_HEAPALLOC <C: #define OCI_ATTR_HEAPALLOC 30 >
OCI_ATTR_INAME <C: #define OCI_ATTR_INAME 25 >
OCI_ATTR_IS_NULL <C: #define OCI_ATTR_IS_NULL 7 >
OCI_ATTR_LIST_TYPE_ATTRS <C: #define OCI_ATTR_LIST_TYPE_ATTRS 229 >
OCI_ATTR_NAME <C: #define OCI_ATTR_NAME 4 >
OCI_ATTR_NESTED_PREFETCH_MEMORY <C: #define OCI_ATTR_NESTED_PREFETCH_MEMORY 14 >
OCI_ATTR_NESTED_PREFETCH_ROWS <C: #define OCI_ATTR_NESTED_PREFETCH_ROWS 12 >
OCI_ATTR_NONBLOCKING_MODE <C: #define OCI_ATTR_NONBLOCKING_MODE 3 >
OCI_ATTR_NUM_ATTRS <C: #define OCI_ATTR_NUM_ATTRS 120 >
OCI_ATTR_NUM_COLS <C: #define OCI_ATTR_NUM_COLS 102 >
OCI_ATTR_NUM_ELEMS <C: #define OCI_ATTR_NUM_ELEMS 234 >
OCI_ATTR_NUM_PARAMS <C: #define OCI_ATTR_NUM_PARAMS 121 >
OCI_ATTR_NUM_TYPE_ATTRS <C: #define OCI_ATTR_NUM_TYPE_ATTRS 228 >
OCI_ATTR_OBJECT <C: #define OCI_ATTR_OBJECT 2 >
OCI_ATTR_PARAM <C: #define OCI_ATTR_PARAM 124 >
OCI_ATTR_PARAM_COUNT <C: #define OCI_ATTR_PARAM_COUNT 18 >
OCI_ATTR_PARSE_ERROR_OFFSET <C: #define OCI_ATTR_PARSE_ERROR_OFFSET 129 >
OCI_ATTR_PASSWORD <C: #define OCI_ATTR_PASSWORD 23 >
OCI_ATTR_PINOPTION <C: #define OCI_ATTR_PINOPTION 36 >
OCI_ATTR_PIN_DURATION <C: #define OCI_ATTR_PIN_DURATION 38 >
OCI_ATTR_PRECISION <C: #define OCI_ATTR_PRECISION 5 >
OCI_ATTR_PREFETCH_MEMORY <C: #define OCI_ATTR_PREFETCH_MEMORY 13 >
OCI_ATTR_PREFETCH_ROWS <C: #define OCI_ATTR_PREFETCH_ROWS 11 >
OCI_ATTR_PTYPE <C: #define OCI_ATTR_PTYPE 123 >
OCI_ATTR_RDBA <C: #define OCI_ATTR_RDBA 104 >
OCI_ATTR_REF_TDO <C: #define OCI_ATTR_REF_TDO 110 >
OCI_ATTR_ROWID <C: #define OCI_ATTR_ROWID 19 >
OCI_ATTR_ROWS_FETCHED <C: #define OCI_ATTR_ROWS_FETCHED 197 >
OCI_ATTR_ROW_COUNT <C: #define OCI_ATTR_ROW_COUNT 9 >
OCI_ATTR_SCALE <C: #define OCI_ATTR_SCALE 6 >
OCI_ATTR_SCHEMA_NAME <C: #define OCI_ATTR_SCHEMA_NAME 9 >
OCI_ATTR_SERVER <C: #define OCI_ATTR_SERVER 6 >
OCI_ATTR_SESSION <C: #define OCI_ATTR_SESSION 7 >
OCI_ATTR_SQLCODE <C: #define OCI_ATTR_SQLCODE 4 >
OCI_ATTR_SQLFNCODE <C: #define OCI_ATTR_SQLFNCODE 10 >
OCI_ATTR_SRVRCTXT <C: #define OCI_ATTR_SRVRCTXT OCI_ATTR_SERVER >
OCI_ATTR_STMT_TYPE <C: #define OCI_ATTR_STMT_TYPE 24 >
OCI_ATTR_TIMESTAMP <C: #define OCI_ATTR_TIMESTAMP 119 >
OCI_ATTR_TRANS <C: #define OCI_ATTR_TRANS 8 >
OCI_ATTR_TRANS_LOCK <C: #define OCI_ATTR_TRANS_LOCK 28 >
OCI_ATTR_TRANS_NAME <C: #define OCI_ATTR_TRANS_NAME 29 >
OCI_ATTR_TYPECODE <C: #define OCI_ATTR_TYPECODE 216 >
OCI_ATTR_TYPE_NAME <C: #define OCI_ATTR_TYPE_NAME 8 >
OCI_ATTR_TYPE_SCHEMA <C: #define OCI_ATTR_TYPE_SCHEMA 118 >
OCI_ATTR_USERNAME <C: #define OCI_ATTR_USERNAME 22 >
OCI_ATTR_VERSION <C: #define OCI_ATTR_VERSION 218 >
OCI_ATTR_XID <C: #define OCI_ATTR_XID 27 >
OCI_ATTR_XNAME <C: #define OCI_ATTR_XNAME 26 >
OCI_COMMIT_ON_SUCCESS <C: #define OCI_COMMIT_ON_SUCCESS 32 >
OCI_CONTINUE <C: #define OCI_CONTINUE -24200 >
OCI_CRED_EXT <C: #define OCI_CRED_EXT 2 >
OCI_CRED_RDBMS <C: #define OCI_CRED_RDBMS 1 >
OCI_DEFAULT <C: #define OCI_DEFAULT 0x00 >
OCI_DESCRIBE_ONLY <C: #define OCI_DESCRIBE_ONLY 16 >
OCI_DTYPE_LOB <C: #define OCI_DTYPE_LOB 50 >
OCI_DTYPE_PARAM <C: #define OCI_DTYPE_PARAM 53 >
OCI_DTYPE_TIMESTAMP <C: #define OCI_DTYPE_TIMESTAMP 68 >
OCI_ENV_NO_MUTEX <C: #define OCI_ENV_NO_MUTEX 8 >
OCI_EV_DEF <C: #define OCI_EV_DEF 0 >
OCI_EV_TSF <C: #define OCI_EV_TSF 1 >
OCI_EXACT_FETCH <C: #define OCI_EXACT_FETCH 2 >
OCI_FETCH_ABSOLUTE <C: #define OCI_FETCH_ABSOLUTE 32 >
OCI_FETCH_FIRST <C: #define OCI_FETCH_FIRST 4 >
OCI_FETCH_LAST <C: #define OCI_FETCH_LAST 8 >
OCI_FETCH_NEXT <C: #define OCI_FETCH_NEXT 2 >
OCI_FETCH_PRIOR <C: #define OCI_FETCH_PRIOR 0x10 >
OCI_FETCH_RELATIVE <C: #define OCI_FETCH_RELATIVE 0x40 >
OCI_FIRST_PIECE <C: #define OCI_FIRST_PIECE 1 >
OCI_HTYPE_DEFINE <C: #define OCI_HTYPE_DEFINE 6 >
OCI_HTYPE_DESCRIBE <C: #define OCI_HTYPE_DESCRIBE 7 >
OCI_HTYPE_DSC <C: #define OCI_HTYPE_DSC OCI_HTYPE_DESCRIBE >
OCI_HTYPE_ENV <C: #define OCI_HTYPE_ENV 1 >
OCI_HTYPE_ERROR <C: #define OCI_HTYPE_ERROR 2 >
OCI_HTYPE_SERVER <C: #define OCI_HTYPE_SERVER 8 >
OCI_HTYPE_SESSION <C: #define OCI_HTYPE_SESSION 9 >
OCI_HTYPE_STM <C: #define OCI_HTYPE_STM OCI_HTYPE_STMT >
OCI_HTYPE_STMT <C: #define OCI_HTYPE_STMT 4 >
OCI_HTYPE_SVC <C: #define OCI_HTYPE_SVC OCI_HTYPE_SVCCTX >
OCI_HTYPE_SVCCTX <C: #define OCI_HTYPE_SVCCTX 3 >
OCI_HTYPE_TRANS <C: #define OCI_HTYPE_TRANS 10 >
OCI_IN_PARAMETER <C: #define OCI_IN_PARAMETER OCI_PARAM_IN >
OCI_LAST_PIECE <C: #define OCI_LAST_PIECE 3 >
OCI_NEED_DATA <C: #define OCI_NEED_DATA 99 >
OCI_NEXT_PIECE <C: #define OCI_NEXT_PIECE 2 >
OCI_NLS_CHARSET_ID <C: #define OCI_NLS_CHARSET_ID 93 >
OCI_NLS_MAXBUFSZ <C: #define OCI_NLS_MAXBUFSZ 100 >
OCI_NO_DATA <C: #define OCI_NO_DATA 100 >
OCI_NTV_SYNTAX <C: #define OCI_NTV_SYNTAX 1 >
OCI_ONE_PIECE <C: #define OCI_ONE_PIECE 0 >
OCI_STMT_SCROLLABLE_READONLY <C: #define OCI_STMT_SCROLLABLE_READONLY 0x08 >
OCI_STMT_SELECT <C: #define OCI_STMT_SELECT 1 >
OCI_SUCCESS <C: #define OCI_SUCCESS 0 >
OCI_SUCCESS_WITH_INFO <C: #define OCI_SUCCESS_WITH_INFO 1 >
OCI_THREADED <C: #define OCI_THREADED 1 >
OCI_TRANS_NEW <C: #define OCI_TRANS_NEW 0x00000001 >
OCI_TRANS_READONLY <C: #define OCI_TRANS_READONLY 0x00000100 >
OCI_TRANS_SERIALIZABLE <C: #define OCI_TRANS_SERIALIZABLE 0x00000400 >
SQLCS_IMPLICIT <C: #define SQLCS_IMPLICIT 1 >
</methods> <methods> Database.OracleInterface <category>parameter</category>
getOracleParameterString: parameterName "Answer the value of the named Oracle parameter, which must be a string. If not present, answer the empty string." ^CEnvironment getenv: parameterName
</methods> <methods> Database.OracleInterface <category>enums</category>
__OCILobMode <C: enum __OCILobMode>
</methods> <methods> Database.OracleInterface class <category>private-accessing</category>
connectionClass ^OracleConnection
</methods> <methods> Database.OracleInterface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." "platform symbols known today include: #nt Windows/NT #win95 Windows95 #hp_unix HP/UX #sun5_unix Solaris #aix_unix AIX #alpha_unix DEC/Unix #os2 OS/2 #powermac Power Mac #mac Mac 68K #linux_i386_unix Linux #linux_x86_64_unix Linux 64-bit #unix_sysV_sun_solaris64 Solaris 64-bit" ^#unknown
</methods> <methods> Database.OracleSolarisInterface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#sun5_unix
</methods> <methods> Database.Oracle64BitInterface <category>types</category>
sb4 <C: typedef signed int sb4>
ub4 <C: typedef unsigned int ub4>
</methods> <methods> Database.OracleBuffer <category>allocation</category>
free "Free the external resources held by this buffer." bufferPointer == nil ifFalse: [ bufferPointer freePointer ]. indicatorsPointer == nil ifFalse: [ indicatorsPointer freePointer ]. cursizPointer == nil ifFalse: [ cursizPointer freePointer ]. bufferPointer := nil. indicatorsPointer := nil. lengthsPointer := nil. rcodesPointer := nil. cursizPointer := nil
mallocForParameter [ "Begin unwind protection" | allocCount longBuffer numArrays pointerBase | allocCount := (count == 0 ifTrue: [ 1 ] ifFalse: [ count ]). longBuffer := databaseType == 94 or: [databaseType == 95]. "Allocate a properly typed buffer pointer." bufferPointer := (longBuffer ifTrue: [ self allocStructuredBuffer: allocCount ] ifFalse: [ self allocScalarBuffer: allocCount ]). "Allocate for all the remaining arrays in one block." numArrays := longBuffer ifTrue: [2] ifFalse: [3]. indicatorsPointer := self allocShortArray: allocCount * numArrays. pointerBase := indicatorsPointer referentAddress. longBuffer ifFalse: [ lengthsPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType. pointerBase := lengthsPointer referentAddress ]. rcodesPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType. "Allocate the current size holder." count == 0 ifFalse: [ cursizPointer := self allocLong ]. "End unwind protection" ] ifCurtailed: [ self free ]. getSelector := GetSelectorMap at: databaseType ifAbsent: [nil]. setSelector := SetSelectorMap at: databaseType ifAbsent: [nil]
mallocForRowBuffer [ "Begin unwind protection" | allocCount longBuffer needRcodes numArrays pointerBase | allocCount := (count == 0 ifTrue: [ 1 ] ifFalse: [ count ]). longBuffer := databaseType == 94 or: [databaseType == 95]. needRcodes := nullsPossible or: [longBuffer]. "Allocate a properly typed buffer pointer." bufferPointer := (longBuffer ifTrue: [ self allocStructuredBuffer: allocCount ] ifFalse: [ self allocScalarBuffer: allocCount ]). "Allocate for all the remaining arrays in one block." numArrays := (longBuffer ifTrue: [ 2 ] ifFalse: [ nullsPossible ifTrue: [3] ifFalse: [2] ]). indicatorsPointer := self allocShortArray: allocCount * numArrays. pointerBase := indicatorsPointer referentAddress. longBuffer ifFalse: [ lengthsPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType. pointerBase := lengthsPointer referentAddress ]. needRcodes ifTrue: [ rcodesPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType ]. "End unwind protection" ] ifCurtailed: [ self free ]. getSelector := GetSelectorMap at: databaseType ifAbsent: [nil]. setSelector := SetSelectorMap at: databaseType ifAbsent: [nil]
mallocUsingSelector: mallocSelector ^self shouldNotImplement
</methods> <methods> Database.OracleBuffer <category>accessing</category>
at: anIndex "Answer the element in the buffer at anIndex." | indexMinus1 rcode | indexMinus1 := anIndex - 1. "rcodesPointer is only allocated if it might need to be checked." rcodesPointer == nil ifFalse: [ rcode := rcodesPointer at: indexMinus1. rcode == 1405 ifTrue: [ ^nil ]. (rcode == 0 or: [rcode == 1406]) ifFalse: "Ignore truncation warnings." [ OracleConnection unableToFetchDataSignal raiseWith: (Array with: (OracleError new dbmsErrorCode: rcode)) errorString: (rcode printStringRadix: 10) ] ]. "Nothing went wrong, so fetch the data." ^self perform: self getSelector with: anIndex
at: anIndex put: aValue "Store aValue at anIndex in the receiver." self perform: self setSelector with: anIndex with: aValue
boundedElementSize ^elementSize
cursizPointer ^cursizPointer
indicatorsPointer ^indicatorsPointer
lengthsPointer ^lengthsPointer
rcodesPointer ^rcodesPointer
session ^session first
session: aSession "Use a weak reference to the owning session object so that it can finalize when not in use." session := WeakArray with: aSession
value "Answer the value (or values) held in the buffer" | array | (count < 1) ifTrue: [ ^self at: 1 ]. array := Array new: count. 1 to: count do: [ :index | array at: index put: (self at: index) ]. ^array
value: aValueOrArray "Store aValueOrArray into the receiver." | isArray | isArray := (aValueOrArray class name == #Array). (count < 1) ifTrue: [ ^self at: 1 put: ( isArray ifTrue: [ aValueOrArray at: 1] ifFalse: [ aValueOrArray ] ). ]. isArray ifTrue: [ | size | size := aValueOrArray size. 1 to: count do:[ :index | self at: index put: ( size >= index ifTrue: [ aValueOrArray at: index ] ifFalse: [ nil ]). ] ] ifFalse: [ self at: 1 put: aValueOrArray. 2 to: count do:[ :index | self at: index put: nil. ] ]. cursizPointer contents: count.
</methods> <methods> Database.OracleBuffer <category>private</category>
allocLong | thePointerType address | thePointerType := DefaultLongPointerType. address := thePointerType primMalloc: 4 pointerKind: thePointerType kind. ^address == nil ifTrue: [ nil ] ifFalse: [ CPointer new newDatum: address ofType: thePointerType ]
allocScalarBuffer: numElements | thePointerType address | thePointerType := DefaultUnsignedCharPointerType. databaseType == 3 ifTrue: [ thePointerType := DefaultLongPointerType ]. databaseType == 4 ifTrue: [ elementSize == 4 ifTrue: [ thePointerType := DefaultFloatPointerType ] ifFalse: [ thePointerType := DefaultDoublePointerType ] ]. address := thePointerType primMalloc: elementSize * numElements pointerKind: thePointerType kind. ^address == nil ifTrue: [ nil ] ifFalse: [ CPointer new newDatum: address ofType: thePointerType ]
allocShortArray: numElements | thePointerType address | thePointerType := DefaultShortPointerType. address := thePointerType primMalloc: 2 * numElements pointerKind: thePointerType kind. ^address == nil ifTrue: [ nil ] ifFalse: [ CPointer new newDatum: address ofType: thePointerType ]
allocStructuredBuffer: numElements | newStruct thePointerType address ptr | newStruct := CCompositeType new beStructure. newStruct at: #length put: 0->Unsigned32BitIntType. newStruct at: #array put: 1->(CArrayType defaultPointer referentType: CIntegerType unsignedChar; numElements: elementSize-4). newStruct align. thePointerType := newStruct pointerType. OracleConnection platformType == #win32s ifTrue: [ thePointerType beFar ]. address := thePointerType primMalloc: elementSize * numElements pointerKind: thePointerType kind. address == nil ifTrue: [ ^nil ] ifFalse: [ ptr := CCompositePointer new newDatum: address ofType: thePointerType ]. ptr memberAt: #length put: (elementSize - 4). ^ptr
allocUnsignedCharArray: numElements | thePointerType address | thePointerType := DefaultUnsignedCharPointerType. address := thePointerType primMalloc: self elementSize * numElements pointerKind: thePointerType kind. ^address == nil ifTrue: [ nil ] ifFalse: [ CPointer new newDatum: address ofType: thePointerType ]
getSelector ^getSelector
setSelector ^setSelector
toVarnum: preShiftedDigits number: number | exponent value isNegative stack digits aDigit outIndex | number == 0 ifTrue: [ ^#[1 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]]. exponent := preShiftedDigits. stack := ByteArray new: 20. value := (isNegative := number < 0) ifTrue: [ number negated ] ifFalse: [ number ]. "Trim off trailing zero digits." [ (value \\ 100 ) == 0 ] whileTrue: [ exponent := exponent - 1. value := value // 100 ]. "Stack the remaining digits up in inverse order." digits := 0. [ value == 0 ] whileFalse: [ aDigit := value \\ 100. digits := digits + 1. stack at: digits put: aDigit. value := value // 100 ]. "Emit the length and exponent bytes." tempArray at: 1 put: ((digits + (isNegative ifTrue: [ 2 ] ifFalse: [ 1 ])) min: 21). tempArray at: 2 put: (isNegative ifTrue: [ 63 - (digits - exponent) ] ifFalse: [ 192 + (digits - exponent) ]). "Emit the digits." outIndex := 3. [ digits == 0 ] whileFalse: [ aDigit := stack at: digits. tempArray at: outIndex put: ( isNegative ifTrue: [ 101 - aDigit ] ifFalse: [ aDigit + 1 ] ). digits := digits - 1. outIndex := outIndex + 1 ]. "If negative, pad with an a magic negative byte." ( isNegative and: [ outIndex < 21 ] ) ifTrue: [ tempArray at: outIndex put: 102 ]. ^tempArray
</methods> <methods> Database.OracleBuffer <category>private-data conversion</category>
at: index putDate: aValue "Store a Timestamp in the buffer." | indexMinus1 ts | indexMinus1 := index - 1. aValue isNil ifTrue: [ ^indicatorsPointer at: indexMinus1 put: -1 ]. indicatorsPointer at: indexMinus1 put: 0. lengthsPointer at: indexMinus1 put: elementSize. ts := aValue asTimestamp. tempArray at: 1 put: ((ts year // 100) + 100); at: 2 put: ((ts year \\ 100) + 100); at: 3 put: ts month; at: 4 put: ts day; at: 5 put: ts hour + 1; at: 6 put: ts minute + 1; at: 7 put: ts second + 1. bufferPointer copyAt: ((index - 1) * elementSize) from: tempArray size: 7 startingAt: 1
at: index putFloat: aValue "Store a float or double at the bufferPointer." "Assume that bufferPointer is coerced to array of float or double." | indexMinus1 | indexMinus1 := index - 1. aValue isNil ifTrue: [ ^indicatorsPointer at: indexMinus1 put: -1 ]. indicatorsPointer at: indexMinus1 put: 0. lengthsPointer at: indexMinus1 put: elementSize. bufferPointer at: indexMinus1 put: aValue
at: index putLongVarchar: string "Answer a string as described in the string pointed to by aCPointer." | indexMinus1 ba size bp | indexMinus1 := index - 1. string isNil ifTrue: [ ^indicatorsPointer at: indexMinus1 put: -1 ]. indicatorsPointer at: indexMinus1 put: 0. "The String we get may come pre-encoded." (string class) == ByteArray ifTrue: [ ba := string ] ifFalse: [ ba := ByteArray fromString: string encoding: self encoding ]. (size := ba size) > (elementSize-4) ifTrue: [ OracleConnection unableToBindSignal raise ]. indexMinus1 == 0 ifTrue: [ bp := bufferPointer ] ifFalse: [ bp := bufferPointer refAt: indexMinus1 ]. bp memberAt: #length put: size. bp copyAt: 4 from: ba size: size startingAt: 1
at: index putLongVarraw: bytes "Store the byte array into the proper slot in the buffer." | indexMinus1 size bp | indexMinus1 := index - 1. bytes isNil ifTrue: [ ^indicatorsPointer at: indexMinus1 put: -1 ]. indicatorsPointer at: indexMinus1 put: 0. "Check that it will really fit." (size := bytes size) > (elementSize-4) ifTrue: [ OracleConnection unableToBindSignal raise ]. indexMinus1 == 0 ifTrue: [ bp := bufferPointer ] ifFalse: [ bp := bufferPointer refAt: indexMinus1 ]. bp memberAt: #length put: size. bp copyAt: 4 from: bytes size: size startingAt: 1
at: index putRaw: bytes "Copy the byte array into the buffer at index." | indexMinus1 size | indexMinus1 := index - 1. bytes isNil ifTrue: [ indicatorsPointer at: indexMinus1 put: -1 ] ifFalse: [ indicatorsPointer at: indexMinus1 put: 0. (size := bytes size) > elementSize ifTrue: [ OracleConnection unableToBindSignal raise ]. lengthsPointer at: indexMinus1 put: size. bufferPointer copyAt: (indexMinus1 * elementSize) from: bytes size: size startingAt: 1 ]
at: index putSignedInteger: aValue "Store a 32-bit signed integer at the bufferPointer." "Assume that bufferPointer is coerced to array of long." | indexMinus1 | indexMinus1 := index - 1. aValue isNil ifTrue: [ ^indicatorsPointer at: indexMinus1 put: -1 ]. indicatorsPointer at: indexMinus1 put: 0. lengthsPointer at: indexMinus1 put: elementSize. bufferPointer at: indexMinus1 put: aValue
at: index putVarchar2: string "Copy string into the buffer at index." "Take care to ensure that the encoding of the characters (bytes) in the string is appropriate to the platform." | indexMinus1 size ba | indexMinus1 := index - 1. string isNil ifTrue: [ ^indicatorsPointer at: indexMinus1 put: -1 ]. indicatorsPointer at: indexMinus1 put: 0. "The String we get may come pre-encoded." (string class) == ByteArray ifTrue: [ ba := string ] ifFalse: [ ba := ByteArray fromString: string encoding: self encoding ]. "Put it into the right slot in the array." (size := ba size) > elementSize ifTrue: [ OracleConnection unableToBindSignal raise ]. lengthsPointer at: indexMinus1 put: size. bufferPointer copyAt: (indexMinus1 * elementSize) from: ba size: size startingAt: 1
at: index putVarnum: number "Answer a numeric object." | indexMinus1 numberBytes | indexMinus1 := index - 1. number isNil ifTrue: [ ^indicatorsPointer at: indexMinus1 put: -1 ]. indicatorsPointer at: indexMinus1 put: 0. lengthsPointer at: indexMinus1 put: elementSize. number class == FixedPoint ifTrue: [ | power100 multiplier | power100 := number scale + 1 // 2. multiplier := 1. power100 timesRepeat: [ multiplier := multiplier * 100 ]. numberBytes := self toVarnum: power100 number: (number * multiplier) rounded ] ifFalse: [ numberBytes := self toVarnum: 0 number: number ]. bufferPointer copyAt: (indexMinus1 * elementSize) from: numberBytes size: 22 startingAt: 1
getDateAt: index "Answer a Timestamp as described in the 7 bytes pointed to by aCPointer." bufferPointer copyAt: ((index - 1) * elementSize) to: tempArray size: 7 startingAt: 1. ^(Timestamp new) year: (((tempArray at: 1) - 100) * 100) + ((tempArray at: 2) - 100); month: (tempArray at: 3); day: (tempArray at: 4); hour: (tempArray at: 5) - 1; minute: (tempArray at: 6) - 1; second: (tempArray at: 7) - 1; millisecond: 0
getFloatAt: index "Answer a Float (or Double) as described in the 4 (or 8) bytes pointed to by aCPointer." "Assume that bufferPointer is coerced to array of float or double." ^bufferPointer at: index - 1
getLongVarcharAt: index "Answer a string as described in the string pointed to by aCPointer." | indexMinus1 bp bytesInString ba | (indexMinus1 := index - 1) == 0 ifTrue: [ bp := bufferPointer ] ifFalse: [ bp := bufferPointer refAt: indexMinus1 ]. bytesInString := bp memberAt: #length. ba := String primitiveArgumentClass new: bytesInString. bp copyAt: 4 to: ba size: bytesInString startingAt: 1. ^ba asStringEncoding: self encoding
getLongVarrawAt: index "Answer a string as described in the string pointed to by aCPointer." | indexMinus1 bp bytes ba | (indexMinus1 := index - 1) == 0 ifTrue: [ bp := bufferPointer ] ifFalse: [ bp := bufferPointer refAt: indexMinus1 ]. bytes := bp memberAt: #length. ba := ByteArray new: bytes. bp copyAt: 4 to: ba size: bytes startingAt: 1. ^ba
getRawAt: index "Answer a ByteArray as described in the string pointed to by aCPointer." | indexMinus1 bytesInField ba | indexMinus1 := index - 1. bytesInField := lengthsPointer at: indexMinus1. ba := ByteArray new: bytesInField. bufferPointer copyAt: (indexMinus1 * elementSize) to: ba size: bytesInField startingAt: 1. ^ba
getSignedIntegerAt: index "Answer a 32-bit integer value from the array pointed to by aCPointer." "Assume that bufferPointer is coerced to array of long." ^bufferPointer at: index - 1
getVarchar2At: index "Answer a string as described in the string pointed to by aCPointer." "The implementation herein depends on the implementation of DLLCC." | bytesInString ba | bytesInString := lengthsPointer at: (index - 1). ba := String primitiveArgumentClass new: bytesInString. bufferPointer copyAt: ((index - 1) * elementSize) to: ba size: bytesInString startingAt: 1. ^ba asStringEncoding: self encoding
getVarnumAt: index "Answer a numeric object." | signExponentByte bytesInNumber isNegative exponent number alreadyShifted byte shift | bufferPointer copyAt: ((index - 1) * elementSize) to: tempArray size: 22 startingAt: 1. "Separate the sign and exponent (they occupy the first byte of the array). The first bit of the signExponentByte is the sign. The number is positive if this bit is a 1. The exponent is the remaining 7 bits and is stored in excess-64 notation. Just to keep life exciting, for negative numbers, the exponent is stored in ones-complement." signExponentByte := tempArray at: 2. (isNegative := (signExponentByte bitAnd: 128) == 0) ifTrue: [ signExponentByte := signExponentByte bitXor: 255 ]. exponent := (signExponentByte bitAnd: 127) - 64. "Convert the numeric bytes into an integer." bytesInNumber := (tempArray at: 1) . 1 == bytesInNumber ifTrue: [ ^0 ]. number := 0. alreadyShifted := 0. 3 to: bytesInNumber + 1 do: [ :bindex | byte := tempArray at: bindex. 102 == byte ifFalse: [ number := 100 * number + (isNegative ifTrue: [ 101 - byte ] ifFalse: [ byte - 1 ]). alreadyShifted := alreadyShifted + 1 ] ]. "Shift the integer based on the exponent to get the right magnitude." shift := exponent - alreadyShifted. shift < 0 ifTrue: [ | denominator | denominator := 1. (0 - shift) timesRepeat: [ denominator := 100 * denominator ]. ^FixedPoint numerator: (isNegative ifTrue: [ 0 - number ] ifFalse: [ number ]) denominator: denominator scale: -2 * shift ]. shift > 0 ifTrue: [ shift timesRepeat: [ number := 100 * number ] ]. "Apply the sign if necessary and answer." ^isNegative ifTrue: [ 0 - number ] ifFalse: [ number ]
</methods> <methods> Database.OracleBuffer <category>initialize-release</category>
columnDescription: colDescr count: allocCount maxLongBytes: maxLongBytes | internalType externalType elemSize precision | internalType := colDescr internalType. "Defaults are to use what given." externalType := internalType. elemSize := colDescr dbsize. nullsPossible := colDescr nullable. "VARCHAR2" internalType == 1 ifTrue: [ "take the default type and size unless too big." elemSize > 4000 ifTrue: [ internalType := 8 "LONG" ] ]. "NUMBER" internalType == 2 ifTrue: [ | scale | "Default to VARNUM" externalType := 6. elemSize := 22. precision := colDescr precision. (((scale := colDescr scale) == -127) and: [precision ~= 0]) ifTrue: ["We have a bona fide floating point number. If the (binary) precision is small enough to represent in C data types float or double, do so." precision <= 46 ifTrue: [ externalType := 4. "FLOAT" precision <= 26 ifTrue: [ elemSize := 4 ] ifFalse: [ elemSize := 8 ] ] ] ifFalse: [ "Not a floating point number." scale == 0 ifTrue: [ (precision <= 9 and: [precision > 0]) ifTrue: [ externalType := 3. "32-bit signed INTEGER" elemSize := 4 ] ] ]. externalType == 6 ifTrue: [ tempArray := ByteArray new: 22 ] ]. "LONG" internalType == 8 ifTrue: [ externalType := 94. "LONG VARCHAR" elemSize := 4 + (maxLongBytes + 3 // 4 * 4) ]. "ROWID" ((internalType == 11) or: [internalType == 104]) ifTrue: [ "ROWID can be as much as 256 bytes in string form." externalType := 1. elemSize := 256 ]. "DATE" internalType == 12 ifTrue: [ "take the default type and size" tempArray := ByteArray new: 7 ]. "RAW" internalType == 23 ifTrue: [ "take the default type and size unless too big." elemSize > 2000 ifTrue: [ internalType := 24 "LONG RAW" ] ]. "LONG RAW" internalType == 24 ifTrue: [ externalType := 95. "LONG VARRAW" elemSize := 4 + (maxLongBytes + 3 // 4 * 4) ]. "CHAR: take the default type and size" "MLSLABEL" internalType == 106 ifTrue: [ elemSize := 255 ]. self elementSize: elemSize count: allocCount databaseType: externalType
for: value conv: convSymbol count: allocCount size: size | elemSize externalType nextSize | nullsPossible := true. (convSymbol == #Array) ifTrue: [ | type | type := self session findRightBindingType: value. ^self for: value conv: type count: allocCount size: size]. convSymbol isNil ifTrue: [ externalType := 1. "VARCHAR2" elemSize := 256 ]. (convSymbol == #String or: [convSymbol == #ByteArray]) ifTrue: [ "Infer elemSize if size isn't given" (elemSize := size) isNil ifTrue: [ "If it's an array, we want to take the longest one so that the buffer will fit them all." (allocCount > 1 or: [value isKindOf: Array]) ifTrue: [ elemSize := value inject: 0 into: [ :currentMax :nextValue | nextSize := ((nextValue isKindOf: Text) or: [(nextValue isKindOf:String) or: [nextValue isKindOf: ByteArray]] ) ifTrue: [ (nextValue isKindOf: ByteArray) ifTrue:[ nextValue size ] ifFalse: [ (ByteArray fromString: nextValue encoding: self encoding) size ]. ] ifFalse: [nextValue]. nextValue == nil ifTrue: [ currentMax ] ifFalse: [ nextSize > currentMax ifTrue: [ nextSize ] ifFalse: [ currentMax ] ] ] ] ifFalse: [ elemSize := ((value isKindOf: ByteArray) ifTrue: [ value] ifFalse: [(ByteArray fromString: value encoding: self encoding)]) size ] ]. convSymbol == #String ifTrue: [ externalType := 1. "VARCHAR2" elemSize > 4000 ifTrue: [ externalType := 94. "LONG VARCHAR" elemSize := 4 + (elemSize + 3 // 4 * 4) ] ]. convSymbol == #ByteArray ifTrue: [ externalType := 23. "RAW" elemSize > 2000 ifTrue: [ externalType := 95. "LONG VARRAW" elemSize := 4 + (elemSize + 3 // 4 * 4) ] ] ]. convSymbol == #Char ifTrue: [ externalType := 96. "CHAR" size isNil ifTrue: [ elemSize := value size ] ifFalse: [ elemSize := size ] ]. convSymbol == #Timestamp ifTrue: [ externalType := 12. "DATE" elemSize := 7. tempArray := ByteArray new: 7 ]. convSymbol == #Float ifTrue: [ externalType := 4. "FLOAT" elemSize := 4 ]. convSymbol == #Double ifTrue: [ externalType := 4. "FLOAT" elemSize := 8 ]. convSymbol == #Integer32 ifTrue: [ externalType := 3. "32-bit signed integer" elemSize := 4 ]. (convSymbol == #Integer or: [convSymbol == #FixedPoint]) ifTrue: [ externalType := 6. "VARNUM" elemSize := 22. tempArray := ByteArray new: 22 ]. convSymbol == #MLSLABEL ifTrue: [ externalType := 106. "MLSLABEL" elemSize := 255 ]. self elementSize: elemSize count: allocCount databaseType: externalType.
</methods> <methods> Database.OracleBuffer <category>testing</category>
canBindNumber: aValue "Answer true or false meaning whether the buffer can be used to bind aValue." | type dataType dataSize | self isForNumber ifFalse: [ ^false ]. aValue class == Array ifTrue: [type := self session findRightBindingType: aValue] ifFalse: [type := aValue oracleConversion]. dataType := self databaseType. dataSize := self elementSize. "DOUBLE" (dataType == 4 and: [dataSize == 8]) ifTrue: [^#(#Float #Double #Integer32) includes: type]. "FLOAT" (dataType == 4 and: [dataSize == 4]) ifTrue: [^type == #Float]. "VARNUM" (dataType == 6 and: [dataSize == 22]) ifTrue: [^#(#Integer32 #Integer #FixedPoint) includes: type]. "32-bit signed integer" (dataType == 3 and: [dataSize == 4]) ifTrue: [^type == #Integer32]. ^false
isForNumber "Answer true or false meaning whether the buffer is used to bind numbers." | dataType | dataType := self databaseType. (((dataType == 4) or: [ dataType == 6 ]) or: [ dataType == 3 ] )ifTrue: [ ^true ]. ^false
</methods> <methods> Database.OracleBuffer class <category>class initialization</category>
initialize "OracleBuffer initialize" self install. "Map the Oracle external datatype codes to get functions." (GetSelectorMap := IdentityDictionary new) add: ( 1 "VARCHAR2" -> #getVarchar2At: ); add: ( 3 "32-bit signed integer" -> #getSignedIntegerAt: ); add: ( 4 "FLOAT" -> #getFloatAt: ); add: ( 6 "VARNUM" -> #getVarnumAt: ); add: ( 12 "DATE" -> #getDateAt: ); add: ( 23 "RAW" -> #getRawAt: ); add: ( 94 "LONG VARCHAR" -> #getLongVarcharAt: ); add: ( 95 "LONG VARRAW" -> #getLongVarrawAt: ); add: ( 96 "CHAR" -> #getVarchar2At: ); add: ( 106 "MLSLABEL" -> #getVarchar2At: ). (SetSelectorMap := IdentityDictionary new) add: ( 1 "VARCHAR2" -> #at:putVarchar2: ); add: ( 3 "32-bit signed integer" -> #at:putSignedInteger: ); add: ( 4 "FLOAT" -> #at:putFloat: ); add: ( 6 "VARNUM" -> #at:putVarnum: ); add: ( 12 "DATE" -> #at:putDate: ); add: ( 23 "RAW" -> #at:putRaw: ); add: ( 94 "LONG VARCHAR" -> #at:putLongVarchar: ); add: ( 95 "LONG VARRAW" -> #at:putLongVarraw: ); add: ( 96 "CHAR" -> #at:putVarchar2: ); add: ( 106 "MLSLABEL" -> #at:putChar: )
</methods> <methods> Database.OracleBuffer class <category>private-activation</category>
install OracleConnection is64Bit ifTrue: [ Unsigned32BitIntType := CIntegerType unsignedInt. Signed32BitIntType := CIntegerType signedInt. ] ifFalse: [ Unsigned32BitIntType := CIntegerType unsignedLong. Signed32BitIntType := CIntegerType signedLong. ]. DefaultDoublePointerType := CLimitedPrecisionRealType double pointerType. DefaultFloatPointerType := CLimitedPrecisionRealType float pointerType. DefaultLongPointerType := Signed32BitIntType pointerType. DefaultShortPointerType := CIntegerType short pointerType. DefaultUnsignedCharPointerType := CIntegerType unsignedChar pointerType. DefaultUnsignedShortPointerType := CIntegerType unsignedShort pointerType. OracleConnection platformType == #win32s ifTrue: [DefaultDoublePointerType beFar. DefaultFloatPointerType beFar. DefaultLongPointerType beFar. DefaultShortPointerType beFar. DefaultUnsignedCharPointerType beFar. DefaultUnsignedShortPointerType beFar].
</methods> <methods> Database.OracleSolaris64Interface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#unix_sysV_sun_solaris64
</methods> <methods> Database.OracleHPUXInterface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#hp_unix
</methods> <methods> Database.OracleSession <category>initialize-release</category>
initialize super initialize. hstmtHolder := nil asValue. herrHolder := nil asValue. bindValuePointersHolder := nil asValue. dependentLobs := WeakDictionary new. sqlPointerHolder := nil asValue. needBinding := true. self maxLongBytes: 32768. "32K, Default for LONG and LONG RAW buffer size." self answerLobAsValue. defaultDisplayLobSize := 4000. "4000 bytes of data, default size for returned Large Objects when using answerLobAsValue."
</methods> <methods> Database.OracleSession <category>accessing</category>
answerLobProxy ^answerLobProxy
answerLobProxy: aBoolean answerLobProxy := aBoolean
bindInput: aBindObject super bindInput: aBindObject. self needBinding: true.
bindInput: aBindObject template: template "Supply aBindObject as the object from which input values should be obtained for host variable references in the SQL text. Host variables may be specified using either a positional or a named notation. The driver may limit to only one form. When using the positional form (a ?), all host variable references (including the named ones) are implicitly ordered by their position in the SQL-text. The n-th variable of aBindObject is used for the n-th host variable reference. If aBindObject has both instance variables and indexed variables, only the indexed variables will be used. When using the named form, the leading colon is removed and the name is expected to be an accessing method on aBindObject (i.e. aBindObject is sent perform: with the name converted to a symbol as the argument)." super bindInput: aBindObject. bindTemplate := template.
bindOutput: aBindObject template: template "Specify the bind object used for returned rows." super bindOutput: aBindObject. resultTemplate := template.
blockFactor: aSmallInteger blockFactor := aSmallInteger min: 10000
defaultDisplayLobSize ^defaultDisplayLobSize
defaultDisplayLobSize: anInteger defaultDisplayLobSize := anInteger
dependentLobs ^dependentLobs
dependentLobs: aBag dependentLobs := aBag.
maxBindSize ^maxBindSize
maxBindSize: anInteger maxBindSize := anInteger
maxLongBytes "Answer the maximum number of bytes which will be fetched for a LONG or LONG RAW field." ^maxLongBytes
maxLongBytes: aSmallInteger "Set the maximum number of bytes which should be fetched for a LONG or LONG RAW field. If the application expects more than the default number of bytes, this value should be increased. If the application expects fewer bytes, some savings in memory use may be achieved by reducing this number. The savings is significant if the blockFactor is set to a large number." "2 is the smallest number of bytes which can be bound for a column" maxLongBytes := 2 max: aSmallInteger
needBinding ^needBinding
needBinding: aBoolean needBinding := aBoolean
scrollable: aBoolean "Determines whether the cursor is scrollable or not." aBoolean ifTrue: [ self hasScrollableCursorSupport ifTrue: [ scrollable := true. ] ifFalse: [ self connection class unsupportedCursorTypeSignal raiseRequest. scrollable := false. ]. ] ifFalse: [ scrollable := false. ].
traceLevel ^traceLevel
</methods> <methods> Database.OracleSession <category>data processing</category>
answerLobAsProxy self answerLobProxy: true
answerLobAsValue self answerLobProxy: false
bindVariable: name "Answer the value of a PL/SQL variable." | buffer | buffer := self bindValuePointers at: name ifAbsent: [ self error: (#errUnboundVariable << #oracleDB >> 'unbound variable') ]. ^buffer value
bindVariable: name value: value "Set the value of a PL/SQL variable." | type | type := (value class == Array) ifTrue: [ self findRightBindingType: value ] ifFalse: [ value oracleConversion ]. self bindVariable: name value: value type: type size: nil
bindVariable: name value: value type: type size: size "Set the value of a PL/SQL variable. The type is restricted to the classes {String, ByteArray, Integer, Double, Float, Timestamp} or the Symbols {String, ByteArray, Char (Oracle7's blank padded behavior), Timestamp, Float, Double, Integer32 (32-bit signed integer), Integer, FixedPoint, MLSLABEL} If size is nil, use a default." | conv count buffer | "Binding an empty array is not allowed." ((value class == Array) and: [ value size == 0 ]) ifTrue: [ self class connectionClass unableToBindSignal raise]. ((type isSymbol) or: [type isNil]) ifTrue: [conv := type] ifFalse: [conv := type name]. value class == Array ifTrue: [count := value size] ifFalse: [count := 0 "scalar"]. (buffer := self bindValuePointers at: name ifAbsent: [nil]) notNil ifTrue: [ ((buffer databaseType == 1 and: [ buffer indicatorsPointer contents == -1]) and: [ value notNil]) ifTrue: ["We'll recreate the buffer" self bindValuePointers removeKey: name. buffer free. buffer := nil] ifFalse: [ [buffer value: value] on: self connection class externalDatabaseErrorSignal do: [:ex | self bindValuePointers removeKey: name. buffer free. buffer := nil. ex return]]. ]. buffer == nil ifTrue: [ buffer := ((( type == #Timestamp or: [ self valueIsTimestamp: value ]) ifTrue: [ self class timestampBufferClass ] ifFalse: [self class bufferClass ]) new encoding: self connection encoding). buffer session: self; for: value conv: conv count: count size: size. buffer session: self; mallocForParameter. self bindValuePointers at: name put: buffer. "Bind the buffer first so that LONG VARCHAR/VARRAW max lengths are still in the first 4 bytes of the buffer." self bindExternal: buffer at: name. buffer value: value]
bindVariableAsLob: name value: value type: type "Set the value of a PL/SQL LOB variable. The type is restricted to the classes {String, ByteArray} or the Symbols {String, ByteArray}. If size is nil, use a default." | conv count buffer | type isSymbol ifTrue: [conv := type] ifFalse: [conv := type name]. value class == Array ifTrue: [count := value size] ifFalse: [count := 0 "scalar"]. (buffer := self bindValuePointers at: name ifAbsent: [nil]) notNil ifTrue: [[buffer value: value] on: self connection class externalDatabaseErrorSignal do: [:ex | self bindValuePointers removeKey: name. buffer free. buffer := nil. ex return]]. buffer == nil ifTrue: [(buffer := self class largeObjectBufferClass new lobFor: value conv: conv count: count) encoding: self connection encoding; session: self; mallocForParameter. self bindValuePointers at: name put: buffer. "Bind the buffer first so that LONG VARCHAR/VARRAW max lengths are still in the first 4 bytes of the buffer." self bindExternal: buffer at: name. "buffer value: value"]
prepare: aString queryIsPLSQL := false. "Prepare aString for processing." self startPrepare. self needBinding ifTrue: [ "Save the query, and prepare it for parameter binding." self setupQuery: aString. ] ifFalse: [ query := aString. ]. "We're finally ready to prepare the SQL. If there is a problem, make sure the state is appropriate." [ "Begin unwind protection." self state: #prepared. self prepareExternal. "End unwind protection." ] ifCurtailed: [ self state: #connected ]
preparePLSQL: aString queryIsPLSQL := true. super prepare: aString
rowCount "Answer the row(s) affected by the last session transaction." ^self connection getAttribute: #OCI_ATTR_ROW_COUNT descriptor: self hstmt type: #OCI_HTYPE_STMT.
setDefaultDisplayLobSizeTo: anInteger self defaultDisplayLobSize: anInteger
startPrepare "Get the receiver into a reasonable state to prepare a new SQL statement." | stateTemp | "Should we clean up after any previous work?" self isExecuting ifTrue: [ self cancel ]. "If not already held, acquire the right to execute SQL statements." (self state == #new ) ifTrue: [ self connect ] . "Enforce: we're in a legal state to prepare new SQL text." (( stateTemp := self state) == #connected or: [ stateTemp == #prepared ] ) ifFalse: [ self class connectionClass invalidSessionStateSignal raise ]. "Release any previously held buffers and adaptors." self releaseBuffersAndAdaptors. "Previous bind parameters are now invalid." self releaseBindings. "Drop the old query texts." query := nil. queryFragments := nil. (self state == #prepared ) ifTrue: [ "Drop the current hstmt and acquire a new one. hopefully this will cause the resources associated with it to be released (i.e. cursors are closed)." self hstmt: nil. self acquireExternal ]. "Default to a connected state" self state: #connected
</methods> <methods> Database.OracleSession <category>printing</category>
printOn: aStream | hstmt | super printOn: aStream. ((hstmt := self hstmt) isNil or: [ hstmt referentAddress isNil ]) ifFalse: [ aStream nextPutAll: '( hstmt = '; nextPutAll: (hstmt referentAddress printStringRadix: 16); nextPutAll: ' )' ]
</methods> <methods> Database.OracleSession <category>private-accessing</category>
bindValuePointersHolder ^bindValuePointersHolder
bindValuePointersHolder: aValueHolder bindValuePointersHolder := aValueHolder
currentRowIndex ^currentRowIndex
currentRowIndex: anInteger currentRowIndex := anInteger
fetchAbsoluteMode ^self class xif OCI_FETCH_ABSOLUTE
fetchNextMode ^self class xif OCI_FETCH_NEXT
fetchPriorMode ^self class xif OCI_FETCH_PRIOR
fetchRelativeMode ^self class xif OCI_FETCH_RELATIVE
herr ^herrHolder value
herr: aCPointerOrNil herrHolder value: aCPointerOrNil
herrHolder ^herrHolder
herrHolder: aValueHolder herrHolder := aValueHolder
hstmt ^hstmtHolder value.
hstmt: aCPointerOrNil | hstmt | ((hstmt := self hstmt ) isNil or: [ hstmt referentAddress isNil ]) ifFalse: [ self unprotectedFreeHstmt ]. hstmtHolder value: aCPointerOrNil.
hstmtHolder ^hstmtHolder
hstmtHolder: aValueHolder hstmtHolder := aValueHolder
hstmtKind ^self connection getAttribute: #OCI_ATTR_STMT_TYPE descriptor: self hstmt type: #OCI_HTYPE_STMT.
rowsInBlock "Answer number of rows fetched in current block." ^rowsInBlock
rowsInBlock: aSmallInteger "Record number of rows fetched in current block." rowsInBlock := aSmallInteger
sqlPointerHolder ^sqlPointerHolder
sqlPointerHolder: aValueHolder sqlPointerHolder := aValueHolder
totalRows ^totalRows
totalRows: anInteger totalRows := anInteger
</methods> <methods> Database.OracleSession <category>private-answer set</category>
aboutToAnswer "Do last-minute work before fetching data from an answer set" | bf | totalRows := 0. self rowsInBlock: (bf := self blockFactor). self currentRowIndex: bf.
advanceExternal "Advance to the next row in the block buffer. If the buffer is exhausted, refill it and continue." self currentRowIndex: (self currentRowIndex + 1). self currentRowIndex > self rowsInBlock ifTrue: [ self rowsInBlock < self blockFactor ifTrue: [ ^nil "No more rows will be found" ]. self getBlockOfRowsExternal. self rowsInBlock <= 0 ifTrue: [ ^nil "No more rows will be found" ]. self currentRowIndex: 1 ]. ^self
advanceExternal: fetchOrientation offset: fetchOffset "Advance to the next row in the block buffer. If the buffer is exhausted, refill it and continue." self scrollable ifFalse: [ self connection class unsupportedCursorTypeSignal raiseRequest. ^nil ]. fetchOrientation == self fetchNextMode ifTrue: [ self currentRowIndex: (self currentRowIndex + 1). ] ifFalse: [ fetchOrientation == self fetchPriorMode ifTrue: [ self currentRowIndex: (self currentRowIndex - 1). ] ifFalse: [ fetchOrientation == self fetchAbsoluteMode ifTrue: [ self currentRowIndex: (self blockFactor + 2). self rowsInBlock: (self blockFactor + 1). ] ifFalse: [ fetchOrientation == self fetchRelativeMode ifTrue: [ self currentRowIndex: (self currentRowIndex + fetchOffset). ]. ]. ]. ]. ((self currentRowIndex > self rowsInBlock) or: [ self currentRowIndex <= 0 ]) ifTrue: [ self getBlockOfRowsExternal: fetchOrientation offset: fetchOffset. self rowsInBlock <= 0 ifTrue: [ ^nil "No more rows will be found" ]. fetchOrientation == self fetchPriorMode ifTrue: [ self currentRowIndex: self rowsInBlock . ] ifFalse: [ self currentRowIndex: 1. ]. ]. ^self
allocateRowBufferExternal: aColumn "Allocate an OracleBuffer to receive data for aColumn. Answer the buffer." | xif colDescr buffer rtval definePointerPointer | xif := self class xif. colDescr := columnDescriptions at: aColumn. buffer := colDescr isLargeObject ifFalse: [( ( colDescr isTimestamp ifTrue: [ self class timestampBufferClass ] ifFalse: [ self class bufferClass ] ) new encoding: self connection encoding) columnDescription: colDescr count: self blockFactor maxLongBytes: self maxLongBytes] ifTrue: [(self class largeObjectBufferClass new encoding: self connection encoding) columnDescription: colDescr count: self blockFactor session: self]. buffer session: self; encoding: connection encoding; mallocForRowBuffer. [definePointerPointer := xif OCIDefine pointerType perform: xif mallocSelector with: 1. definePointerPointer contents: (xif OCIDefine pointerType cast: nil). "This is essential!!" rtval := xif OCIDefineByPos: self hstmt with: definePointerPointer with: self herr with: aColumn with: buffer pointer with: buffer elementSize with: buffer databaseType with: buffer indicatorsPointer with: buffer lengthsPointer with: buffer rcodesPointer with: xif OCI_DEFAULT. rtval == xif OCI_SUCCESS ifFalse: [| errs | errs := connection getErrors. ^self connection class unableToBindSignal raiseWith: errs errorString: errs first dbmsErrorString]] ensure: [definePointerPointer == nil ifFalse: [definePointerPointer freePointer]]. ^buffer
answerOfClass: anAnswerStreamClass "Answer an instance of the given subclass of ExternalDatabaseAnswerStream" "Assert: anAnswerStreamClass isKindOf: ExternalDatabaseAnswerStream" | initialAnswer | initialAnswer := ( self state == #ready ). self state: #validResults. initialAnswer ifTrue: [ "Verify that the query executed without error." self resultsExternal ifFalse: [ ^#noAnswerStream ] ] ifFalse: [ "If we're still holding on to a prior answer stream, dismiss it." answerStream notNil ifTrue: [ answerStream close ]. "Assert: self state == #validResults" self moreResultsExternal ifFalse: [ self state: #prepared. ^#noMoreAnswers ] ]. self hasAnswerSetExternal ifTrue: [ | answer | initialAnswer ifFalse: [ "Previous descriptions/buffers are no longer valid" self releaseBuffers. self releaseAdaptors. self columnDescriptions: nil ]. self getColumnDescriptions. self acquireBuffers. self setupAdaptors. self aboutToAnswer. answer := anAnswerStreamClass newForSession: self. self answerStream: answer. self state: #fetchingData. ^answer ]. ^#noAnswerStream.
answerStreamDismissed "Close the cursor and discard pending results." super answerStreamDismissed.
cancelAnswerSetExternal "Explicity cancel current or previous query results." | xif rtval errs hstmt herr | xif := self class xif. hstmt := self hstmt. herr := self herr. rtval := xif OCIStmtFetch: hstmt with: herr with: 0 with: xif OCI_FETCH_NEXT with: xif OCI_DEFAULT. (traceLevel >= 2) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIStmtFetch( hstmt ='; nextPutAll: (hstmt referentAddress printStringRadix: 16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ' , nrows = 0 '; nextPutAll: ' , orientation = OCI_FETCH_NEXT '; nextPutAll: ' , mode = OCI_DEFAULT)'. self class trace: self emitTrace]. (rtval == xif OCI_NO_DATA) ifTrue: [ "Try to flush the server's error list" self getStatementErrors. ^nil. ]. (rtval == xif OCI_SUCCESS or: [rtval == xif OCI_SUCCESS_WITH_INFO]) ifFalse: [ errs := self getStatementErrors. ^self class connectionClass unableToFetchDataSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^self
describeAnswerColumns "Fill in the columnDescriptions array." | columnCount colDescrStream hdescriptor | columnCount := 0. colDescrStream := WriteStream on: (Array new: 512). [(hdescriptor := self connection getSchemaObjectAttributeFromDescriptorExternal: self hstmt type: #OCI_HTYPE_STMT startingAt: (columnCount := columnCount + 1)) notNil ] whileTrue: [ | colDescr internalSize internalType | "Retrieve type from descriptor; describe if necessary." (colDescr := self class columnDescriptionClass new) index: columnCount; name: (self connection getAttribute: #OCI_ATTR_NAME descriptor: hdescriptor type: #OCI_DTYPE_PARAM); dbsize: (internalSize := self connection getAttribute: #OCI_ATTR_DATA_SIZE descriptor: hdescriptor type: #OCI_DTYPE_PARAM); internalType: (internalType := self connection getAttribute: #OCI_ATTR_DATA_TYPE descriptor: hdescriptor type: #OCI_DTYPE_PARAM); type: (self class typeFor: internalType); maxColumnConstraint: internalSize; precision: (self connection getAttribute: #OCI_ATTR_PRECISION descriptor: hdescriptor type: #OCI_DTYPE_PARAM); scale: (self connection getAttribute: #OCI_ATTR_SCALE descriptor: hdescriptor type: #OCI_DTYPE_PARAM); nullable: (self connection getAttribute: #OCI_ATTR_IS_NULL descriptor: hdescriptor type: #OCI_DTYPE_PARAM) == 1. colDescrStream nextPut: colDescr ]. self numColumns: columnCount - 1. self columnDescriptions: (columnCount > 0 ifTrue: [ colDescrStream contents ] ifFalse: [ nil ]).
getBlockOfRowsExternal "Fetch the next block of rows into the memory allocated for this purpose." | xif rtval errs hstmt herr priorTotal| priorTotal := self totalRows. xif := self class xif. hstmt := self hstmt. herr := self herr. rtval := xif OCIStmtFetch: hstmt with: herr with: blockFactor with: xif OCI_FETCH_NEXT with: xif OCI_DEFAULT. (traceLevel >= 2) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIStmtFetch( hstmt ='; nextPutAll: (hstmt referentAddress printStringRadix: 16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ' , nrows = '; print: blockFactor; nextPutAll: ' , orientation = OCI_FETCH_NEXT '; nextPutAll: ' , mode = OCI_DEFAULT)'. self class trace: self emitTrace]. self totalRows: (self connection getAttribute: #OCI_ATTR_ROW_COUNT descriptor: hstmt type: #OCI_HTYPE_STMT). self scrollable ifTrue: [ self rowsInBlock: (self connection getAttribute: #OCI_ATTR_ROWS_FETCHED descriptor: hstmt type: #OCI_HTYPE_STMT). ] ifFalse: [ self rowsInBlock: (self totalRows - priorTotal). ]. (rtval == xif OCI_NO_DATA) ifTrue: [ ^nil. ]. (rtval == xif OCI_SUCCESS or: [rtval == xif OCI_SUCCESS_WITH_INFO]) ifFalse:[ errs := self getStatementErrors. ^self class connectionClass unableToFetchDataSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^self
getBlockOfRowsExternal: fetchOrientation offset: fetchOffset "Fetch the next block of rows into the memory allocated for this purpose." | xif rtval errs hstmt herr newFetchMode newOffset | xif := self class xif. hstmt := self hstmt. herr := self herr. fetchOrientation == self fetchPriorMode ifTrue: [ newFetchMode := self fetchRelativeMode. newOffset := 1 - (2 * self blockFactor). ] ifFalse: [ fetchOrientation == self fetchRelativeMode ifTrue: [ newFetchMode := fetchOrientation. self currentRowIndex: (self currentRowIndex - fetchOffset). newOffset := fetchOffset - self rowsInBlock + self currentRowIndex. ] ifFalse: [ newFetchMode := fetchOrientation. newOffset := fetchOffset. ]. ]. rtval := xif OCIStmtFetch2: hstmt with: herr with: blockFactor with: newFetchMode with: newOffset with: xif OCI_DEFAULT. (traceLevel >= 2) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIStmtFetch( hstmt ='; nextPutAll: (hstmt referentAddress printStringRadix: 16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ' , nrows = '; print: blockFactor; nextPutAll: ' , orientation = OCI_FETCH_NEXT '; nextPutAll: ' , mode = OCI_DEFAULT)'. self class trace: self emitTrace]. self totalRows: (self connection getAttribute: #OCI_ATTR_ROW_COUNT descriptor: hstmt type: #OCI_HTYPE_STMT). self rowsInBlock: (self connection getAttribute: #OCI_ATTR_ROWS_FETCHED descriptor: hstmt type: #OCI_HTYPE_STMT). (rtval == xif OCI_NO_DATA) ifTrue: [ ^nil. ]. (rtval == xif OCI_SUCCESS or: [rtval == xif OCI_SUCCESS_WITH_INFO]) ifFalse:[ errs := self getStatementErrors. ^self class connectionClass unableToFetchDataSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^self
getColumnDescriptions "Get descriptions for the columns in the answer set" "If column descriptions exist, they're safe to re-use." ( columnDescriptions == nil ) ifFalse: [ ^self ]. self describeAnswerColumns. " ( resultTemplate == nil ) ifTrue: [ self describeAnswerColumns ] ifFalse: [ self answerColumnsFromTemplate ]"
getFieldExternal: aColumn | buffer | buffer := (self rowBuffers) at: aColumn. ^buffer at: ((self currentRowIndex - 1) \\ self blockFactor) + 1
getFieldExternal: aColumn template: template | buffer | buffer := (self rowBuffers) at: aColumn. ^buffer valueViaTemplate: template
hasAnswerSetExternal ^(self hstmtKind == self class xif OCI_STMT_SELECT )
releaseBuffers "Release buffers and their associated resources." | rbs | (rbs := self rowBuffers) notNil ifTrue: [1 to: rbs size do: [:aColumn | (rbs at: aColumn) session: self; free]]. super releaseBuffers
releaseBuffersAndAdaptors "Release buffers, adaptors, and their associated resources." "Subclasses may release subclass-specific resources before invoking this method." "Discard previous buffers, descriptors, and adaptors, but not lob proxies" self releaseBuffers. self releaseAdaptors. self columnDescriptions: nil. self numColumns: nil.
releaseDependentLobs "Release dependent LOB resources." | depLobs | (depLobs := self dependentLobs) isEmpty ifFalse: [ depLobs associationsDo: [:ass | | val | depLobs removeKey: ass key ifAbsent:[]. val := ass value. (val isKindOf: OracleLobProxy) ifTrue: [ val session: self; disconnect ]. ] ].
</methods> <methods> Database.OracleSession <category>private-binding</category>
bindExternal queryIsPLSQL ifTrue: [ self bindPLSQL ] ifFalse: [ bindInput isNil ifFalse: [ self bindPrepare. "For each bind marker in the query fragments, get the corresponding value from the bindInput object. If the value isn't already bound, bind and remember it." 2 to: queryFragments size by: 2 do: [ :index | | bindMarker value | bindMarker := queryFragments at: index. value := self inBindInputAt: bindMarker. bindMarker isInteger ifTrue: [ | bindPosition | bindPosition := index / 2. ( self boundValueAt: bindPosition is: value ) ifFalse: [ self bindValue: value at: bindPosition. self bindValues at: bindPosition put: value. ] ] ifFalse: [ ( self boundValueAt: bindMarker is: value ) ifFalse: [ self bindValue: value at: bindMarker. self bindValues at: bindMarker put: value. ] ] ]. ]. ]
bindExternal: buffer at: position "Provide a positional binding to the OCI." | bindPointerPointer | ["Begin unwind protection (1)|" | rtval xif | xif := self class xif. bindPointerPointer := xif OCIBind pointerType perform: xif mallocSelector with: 1. bindPointerPointer contents: (xif OCIBind pointerType cast: nil ). "This is essential!!" position isInteger ifTrue: [ rtval := xif OCIBindByPos: self hstmt with: bindPointerPointer with: self connection herr with: position with: buffer pointer with: buffer boundedElementSize with: buffer databaseType with: buffer indicatorsPointer with: buffer lengthsPointer with: buffer rcodesPointer with: (queryIsPLSQL ifTrue: [buffer count] ifFalse:[0]) with: (queryIsPLSQL ifTrue: [buffer cursizPointer] ifFalse:[0]) with: xif OCI_DEFAULT. ] ifFalse: [ rtval := xif OCIBindByName: self hstmt with: bindPointerPointer with: self connection herr with: position gcCopyToHeap with: position size with: buffer pointer with: buffer boundedElementSize with: buffer databaseType with: buffer indicatorsPointer with: buffer lengthsPointer with: buffer rcodesPointer with: (queryIsPLSQL ifTrue: [buffer count] ifFalse:[0]) with: (queryIsPLSQL ifTrue: [buffer cursizPointer] ifFalse:[0]) with: xif OCI_DEFAULT. ]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := connection getErrors. ^connection class unableToBindSignal raiseSignal: errs first dbmsErrorString ]. "End unwind protection (1) " ] ensure: [ bindPointerPointer == nil ifFalse: [ bindPointerPointer freePointer ] ].
bindNameFor: position "Answer the textual name to use as a bind name for the given position." | strm | strm := WriteStream on: (String new: 16). self bindNameFor: position on: strm. ^strm contents
bindNameFor: position on: aStream "Put the textual name to use as a bind name for the given position on aStream." aStream nextPut: $:. position isSymbol ifTrue: [ aStream nextPutAll: position ] ifFalse: [ aStream nextPut: $p. aStream print: position ]
bindPLSQL "Bind values for a PL/SQL query." | bound position | position := 0. bound := IdentitySet new: self bindValuePointers capacity. 2 to: queryFragments size by: 2 do: [ :index | | bindMarker buffer | position := position + 1. bindMarker := queryFragments at: index. ( bound includes: bindMarker ) ifFalse: [ buffer := self bindValuePointers at: bindMarker ifAbsent: [ nil ]. buffer isNil ifTrue: [ ^self connection class missingBindVariableSignal raise ]. bound add: bindMarker ] ]
bindPrepare "Examine the input bound values, and find the largest array, assign maxBindSize so that all buffers will acquire this capacity." | bindInputAsArray | bindInputAsArray := OrderedCollection new. 2 to: queryFragments size by: 2 do: [ :index | | bindMarker value | bindMarker := queryFragments at: index. value := self inBindInputAt: bindMarker. bindInputAsArray add: value. ]. self maxBindSize: ( bindInputAsArray inject: 0 into: [ :currentMax :nextValue | | nextSize | nextSize := (nextValue class name == #Array) ifTrue: [nextValue size] ifFalse: [1]. nextSize max: currentMax]).
bindValue: aValue at: position "Bind aValue to the given position." | buffer | (buffer := self bindValuePointers at: position ifAbsent: [nil]) notNil ifTrue: [ (((buffer databaseType == 1 and: [ buffer indicatorsPointer contents == -1]) or: [ | bindSize | ((bindSize := self maxBindSize) > 1) and: [ bindSize > buffer count]]) or: [ buffer isForNumber and: [ (buffer canBindNumber: aValue) not ] ]) ifTrue: ["We'll recreate the buffer if the following conditions are met: (1) Previous bind object was nil, so we should recreate the buffer with correct type. (2) The binding value is an array with at least 2 elements, and the array's size is greater than the buffer's count. (3) If the buffer is for numbers, it can not be used to bind the number or numbers in aValue. Note: DB may complain if the new buffer type is overly different from string." self bindValuePointers removeKey: position. buffer free. buffer := nil] ifFalse: [ [buffer value: aValue] on: self connection class unableToBindSignal do: [:ex | self bindValuePointers removeKey: position. buffer free. buffer := nil. ex return] ] ]. buffer isNil ifTrue: [buffer := ((self valueIsTimestamp: aValue) ifTrue: [ self class timestampBufferClass ] ifFalse: [self class bufferClass ]) new encoding: connection encoding. (self maxBindSize > 1) ifTrue: [ buffer session: self. buffer for: aValue conv: aValue oracleConversion count: self maxBindSize size: nil. ] ifFalse: [ buffer for: aValue conv: aValue oracleConversion count: 0 size: nil. ]. buffer session: self. buffer mallocForParameter. self bindValuePointers at: position put: buffer. "Bind the buffer first so that LONG VARCHAR/VARRAW max lengths are still in the first 4 bytes of the buffer." self bindExternal: buffer at: position. buffer value: aValue]
bindValuePointers "Answer with the receiver's bind pointer array." | bvph | (bvph := self bindValuePointersHolder) value isNil ifTrue: [ bvph value: IdentityDictionary new ]. ^bvph value
findRightBindingType: anArray "Answer the conversion type fitting all elements of anArray" | types | types := OrderedCollection new. anArray do: [:each | | type | (type := each oracleConversion) notNil ifTrue: [ (types includes: type) ifFalse: [ types add: type]] ]. types size = 1 ifTrue: [^types first]. (types includes: #Double) ifTrue: [ ( (types includes: #FixedPoint) or: [ types includes: #Integer ]) ifTrue: [ self connection class inconsistentDataTypesInArrayBindingSignal raise. ] ifFalse: [ ^#Double ] ]. (types includes: #FixedPoint) ifTrue: [ (types includes: #Float) ifTrue: [ self connection class inconsistentDataTypesInArrayBindingSignal raise. ] ifFalse: [ ^#FixedPoint ] ]. (types includes: #Integer) ifTrue: [ (types includes: #Float) ifTrue: [ self connection class inconsistentDataTypesInArrayBindingSignal raise. ] ifFalse: [ ^#Integer ] ]. (types includes: #Float) ifTrue: [ (types includes: #Integer32) ifTrue: [ ^#Double ] ifFalse: [ ^#Float ] ]. (types includes: #Integer32) ifTrue: [ ^#Integer ]. ^nil
prepareExternal "Prepare the query for execution via OCIStatmentPrepare." | sql xif hstmt herr sqlBytes sqlPointer rtval | hstmt := self hstmt. herr := self herr. self needBinding ifTrue: [ "Assemble the SQL to prepare." queryFragments size == 1 ifTrue: [ sql := queryFragments at: 1 ] ifFalse: [ | sqlStream | sqlStream := WriteStream on: (String new: query size * 2). sqlStream nextPutAll: (queryFragments at: 1). 2 to: queryFragments size by: 2 do: [ :index | sqlStream nextPutAll: (self bindNameFor: (queryFragments at: index)); nextPutAll: (queryFragments at: (index + 1)) ]. sql := sqlStream contents ]. ] ifFalse: [ sql := query. ]. "Prepare the query text." xif := self class xif. sqlBytes := ByteArray fromString: sql encoding: connection encoding. sqlPointer := sqlBytes perform: xif copyToHeapSelector. self sqlPointerHolder value: sqlPointer. rtval := xif OCIStmtPrepare: self hstmt with: self herr with: sqlPointer with: sqlBytes size with: xif OCI_NTV_SYNTAX with: xif OCI_DEFAULT. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIStmtPrepare( hstmt ='; nextPutAll: (hstmt referentAddress printStringRadix: 16); nextPutAll: ', herr ='; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ', SQL = '; nextPutAll: sql; nextPutAll: ', length = '; print: sqlBytes size; nextPutAll: ', syntax = OCI_NTV_SYNTAX, mode = OCI_DEFAULT)';crtab. self class trace: self emitTrace ]. rtval == xif OCI_SUCCESS ifFalse: [ | errs | errs := self getStatementErrors. ^self class connectionClass unableToPrepareSignal raiseWith: errs errorString: errs first dbmsErrorString].
releaseBindings | bvp sqlPointer | (sqlPointer := self sqlPointerHolder value) notNil ifTrue: [sqlPointer freePointer. self sqlPointerHolder value: nil]. (bvp := self bindValuePointersHolder value) notNil ifTrue: [bvp do: [:each | each notNil ifTrue: [each session: self; free]]. self bindValuePointersHolder value: nil]. super releaseBindings
</methods> <methods> Database.OracleSession <category>private-execution</category>
acquireExternal "Acquire external resources." ["Begin unwind protection." self unprotectedAllocHstmt. self herr: self connection herr. "End unwind protection."] ifCurtailed: [ self herr: nil. self hstmt: nil ]
cancelExternal "Handle cleanup when current query is cancelled." ^self
dismissExternal "Release external resources held." [ (self connection inTransactionMode ) ifFalse: [ self connection commit ]. "If the connection is in object mode, flush the cache." "self connection flushObjectCacheExternal." ] ensure: [ self herr: nil. self hstmt: nil ] .
executeExternal | rtval xif hsvcctx hstmt herr iterations rowOffset mode | xif := self class xif. hsvcctx := self connection hsvcctx. hstmt := self hstmt. herr := self herr. rowOffset := 0. self scrollable ifTrue: [ mode := xif OCI_STMT_SCROLLABLE_READONLY. ] ifFalse: [ mode := xif perform: self connection executionMode. ]. iterations := (self isSELECT ) ifTrue: [0 ] ifFalse: [ (((self bindValuePointersHolder value) isNil) or: [ queryIsPLSQL ] ) ifTrue: [ 1 ] ifFalse: [ self maxBindSize ] ]. rtval := xif OCIStmtExecute: hsvcctx with: hstmt with: herr with: iterations with: rowOffset with: 0 with: 0 with: mode. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIStmtExecute( hsvcctx ='; nextPutAll: (hsvcctx referentAddress printStringRadix: 16); nextPutAll: ', hstmt ='; nextPutAll: (hstmt referentAddress printStringRadix: 16); nextPutAll: ', herr ='; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ', iterations ='; print: iterations; nextPutAll: ', rowOffset ='; print: rowOffset; nextPutAll: ', snap_shot_in = NULL, snap_shot_out = NULL '; nextPutAll: ', mode = '; nextPutAll: mode printString; nextPutAll: ')';crtab. self class trace: self emitTrace ]. rtval == xif OCI_SUCCESS ifFalse: [ self resultsCache: self getStatementErrors. self resultsExternal ]. ( connection inTransactionMode ) ifFalse: ["If we're not in a multi-statement transaction, then just committed manually iff the following is true:." self isSELECT ifFalse: [ connection commit ] ]
getError: returnValue "Take the prevailing error information and prepare it to be used as the parameter to an exception." ^Array with: returnValue
installExternal super installExternal. self herr: nil. self hstmt: nil
moreResultsExternal "There are never any more results." ^false
readyExternal ^true
resultsExternal | errs | (errs := self resultsCache) notNil ifTrue: [ | errorParameter error signal connClass | errorParameter := self getError: errs first. error := errorParameter first. signal := (connClass := connection class) perform: (connClass signalMap at: error dbmsErrorCode abs ifAbsent: [ #unableToExecuteSQLSignal ]). signal mayResume ifTrue: [ signal raiseRequestWith: errorParameter errorString: (' \' withCRs, error dbmsErrorString). ] ifFalse: [ signal raiseWith: errorParameter errorString: (' \' withCRs, error dbmsErrorString). ]. ^false ]. ^true
</methods> <methods> Database.OracleSession <category>private-finalization</category>
executor "Answer with the executor." | ex | ex := super executor. ex hstmtHolder: self hstmtHolder. ex herrHolder: self herrHolder. ex bindValuePointersHolder: self bindValuePointersHolder. ex sqlPointerHolder: self sqlPointerHolder. ex dependentLobs: self dependentLobs. ^ex
finalizeExternal "Release all external resource." | hstmt | self releaseBuffersAndAdaptors. self releaseDependentLobs. self releaseBindings. ((hstmt := self hstmt) isNil or: [ hstmt referentAddress isNil ]) ifTrue: [ ^self ]. ( traceLevel >= 1 ) ifTrue: [ self class trace: nil ]. super finalizeExternal
key "The cursorHolder is unique to the session and is constant across pause/resume." ^self hstmtHolder
</methods> <methods> Database.OracleSession <category>private-testing</category>
hasScrollableCursorSupport "Answer true is the loaded OCI has scrollable cursor support." | xifClass testMethod aHandle resultHandle | xifClass := self class xif class. testMethod := OracleInterface compiledMethodAt:#OCIStmtFetch2:with:with:with:with:with:. resultHandle := xifClass instanceBehavior libraryFiles detect: [:aLibrary | aHandle := testMethod class mapAddressFor: testMethod library: aLibrary. aHandle notNil] ifNone: [ aHandle := testMethod class mapStaticFor: testMethod ]. resultHandle isNil ifTrue: [ ^false ] ifFalse: [ ^true ]
isDDL "Answer true if the SQL statement type indicates that we are processing a ALTER , CREATE, DROP." ^#[ 7 "self connection class xif OCI_STMT_ALTER" 5 "self connection class xif OCI_STMT_CREATE" 6 "self connection class xif OCI_STMT_DROP" ] includes: self hstmtKind
isDML "Answer true if the SQL statement type indicates that we are processing a INSERT, UPDATE, DELETE." ^#[ 4 "self connection class xif OCI_STMT_INSERT" 2 "self connection class xif OCI_STMT_UPDATE" 3 "self connection class xif OCI_STMT_DELETE" ] includes: self hstmtKind
isPLSQL "Answer true if the SQL statement type indicates that we are processing a PL/SQL BEGIN DECLARE operation ." ^#[ 8 "self connection class xif OCI_STMT_BEGIN" 9 "self connection class xif OCI_STMT_DECLARE" ] includes: self hstmtKind
isSELECT "Answer true if the SQL statement type indicates that we are processing a QUERY." ^(self hstmtKind == 1 "OCI_STMT_SELECT" )
valueIsTimestamp: aValue "Answer true if the value is a Timestamp or an Array of Timestamp. " | convSymbol | convSymbol := aValue oracleConversion. ((convSymbol == #Timestamp) and: [ aValue year ~~ 0 ]) ifTrue: [ ^true ]. (convSymbol == #Array) ifTrue: [ | representativeElement | representativeElement := aValue detect: [:each | each notNil] ifNone: [nil]. ((representativeElement class name == #Timestamp) and: [ representativeElement year ~~ 0 ]) ifTrue: [ ^true ] ]. ^false
</methods> <methods> Database.OracleSession <category>private-results cache</category>
resultsCache "Answer the contents of the results cache. Clear after accessing." | results | results := resultsCache. self resultsCache: nil. ^results
resultsCache: results "Cache the results." resultsCache := results
</methods> <methods> Database.OracleSession <category>private-handles</category>
unprotectedAllocHstmt | xif hstmtPointerPointer | xif := self class xif. ["Begin unwind protection (1)" hstmtPointerPointer := xif OCIStmt pointerType perform: xif mallocSelector with: 1. connection allocHandlePointerExternal: hstmtPointerPointer type: #OCI_HTYPE_STMT. self hstmtHolder value: hstmtPointerPointer contents. "End unwind protection (1)"] ensure: [ hstmtPointerPointer == nil ifFalse: [ hstmtPointerPointer freePointer ] ]
unprotectedFreeHstmt connection freeHandlePointerExternal: self hstmt type: #OCI_HTYPE_STMT
</methods> <methods> Database.OracleSession <category>private-error accessing</category>
getStatementErrors "Return a collection of OracleOCIError(s) associated with the statement handle." ^connection getErrors
parseErrorOffset "Answer the location in the query string where the parser says there was an error." ^self connection getAttribute: #OCI_ATTR_PARSE_ERROR_OFFSET descriptor: self hstmt type: #OCI_HTYPE_STMT.
</methods> <methods> Database.OracleSession <category>private-activation</category>
dismiss self isExecuting ifTrue: [ self cancel ]. self releaseBuffersAndAdaptors. self releaseDependentLobs. self releaseBindings. super dismiss. connection removeParticipant: self
quiesce "Quiesce all connections to external resources." self state == #paused ifTrue: [ ^self ]. answerStream notNil ifTrue: [ answerStream dismiss ]. [ self dismiss ] ensure: [ self state: #paused ]
</methods> <methods> Database.OracleSession <category>prefetch</category>
setPrefetchRows: anInteger "set the number of prefetched rows (possible only with OCI 8). a setPrefetchRows: could be nice in OracleSession" self connection setAttribute: anInteger type: #OCI_ATTR_PREFETCH_ROWS descriptor: self hstmt type: #OCI_HTYPE_STMT
</methods> <methods> Database.OracleSession class <category>class initialization</category>
initialize "OracleSession initialize" self initRegistry. (InternalDatatypeToClassMap := IdentityDictionary new) add: ( 1 "VARCHAR2" -> #String ); add: ( 2 "NUMBER" -> #Number ); add: ( 8 "LONG" -> #String ); add: ( 11 "ROWID" -> #String ); add: ( 12 "DATE" -> #Timestamp ); add: ( 23 "RAW" -> #ByteArray ); add: ( 24 "LONG RAW" -> #ByteArray ); add: ( 96 "CHAR" -> #String ); add: ( 104 "ROWID" -> #String ); add: ( 106 "MLSLABEL" -> #String ); add: ( 112 "Character LOB" -> #String ); add: ( 113 "Binary LOB" -> #ByteArray ); add: ( 187 "TIMESTAMP" -> #Timestamp ).
</methods> <methods> Database.OracleSession class <category>private-accessing</category>
typeFor: aDatabaseType "Answer the class which is equivalent to the database type: aDatabaseType." ^InternalDatatypeToClassMap at: aDatabaseType ifAbsent: [ nil ]
</methods> <methods> Database.OracleSession class <category>private-registry</category>
registry ^RegisteredOracleSessions
registry: aCollection RegisteredOracleSessions := aCollection
</methods> <methods> Database.OracleSession class <category>accessing</category>
bufferClass "Answer the class to use for bindInput/Output objects associated with receiver." ^OracleBuffer
columnDescriptionClass ^OracleColumnDescription
connectionClass "Answer the connection class for sessions" ^OracleConnection
largeObjectBufferClass "Answer the class to use for bindInput/Output objects associated with receiver." ^OracleLargeObjectBuffer
timestampBufferClass "Answer the class to use for bindInput/Output objects associated with receiver." ^OracleTimestampBuffer
</methods> <methods> Database.OracleSession class <category>private-activation</category>
install self bufferClass install.
</methods> <methods> Database.OracleTimestampBuffer <category>initialize-release</category>
columnDescription: colDescr count: allocCount maxLongBytes: maxLongBytes | internalType externalType elemSize | internalType := colDescr internalType. "Defaults are to use what given." externalType := internalType. elemSize := colDescr dbsize. nullsPossible := colDescr nullable. self elementSize: elemSize count: allocCount databaseType: externalType
for: value conv: convSymbol count: allocCount size: size | elemSize externalType | nullsPossible := true. (convSymbol == #Array) ifTrue: [ | representativeElement | representativeElement := value detect: [:each | each notNil] ifNone: [nil]. ^self for: representativeElement conv: representativeElement oracleConversion count: allocCount size: size]. convSymbol isNil ifTrue: [ externalType := 1. "VARCHAR2" elemSize := 256 ]. externalType := 187. "Timestamp" self elementSize: elemSize count: allocCount databaseType: externalType.
initialize "Initialize an instance of the receiver." super initialize. "Pointers in the receiver are not allocated yet." pointerInitialized := false
</methods> <methods> Database.OracleTimestampBuffer <category>private - allocation</category>
allocateConversionPointers "Allocate pointers used in the conversion process." | ub1Type ub4Type sb2Type | sb2Type := DefaultShortPointerType. ub1Type := DefaultUnsignedCharPointerType. ub4Type := Unsigned32BitIntType pointerType. yearPointer := CPointer new newDatum: (sb2Type primMalloc: 1 pointerKind: sb2Type kind) ofType: sb2Type. monthPointer := CPointer new newDatum: (ub1Type primMalloc: 1 pointerKind: ub1Type kind) ofType: ub1Type. dayPointer := CPointer new newDatum: (ub1Type primMalloc: 1 pointerKind: ub1Type kind) ofType: ub1Type. hourPointer := CPointer new newDatum: (ub1Type primMalloc: 1 pointerKind: ub1Type kind) ofType: ub1Type. minPointer := CPointer new newDatum: (ub1Type primMalloc: 1 pointerKind: ub1Type kind) ofType: ub1Type. secPointer := CPointer new newDatum: (ub1Type primMalloc: 1 pointerKind: ub1Type kind) ofType: ub1Type. fsecPointer := CPointer new newDatum: (ub4Type primMalloc: 1 pointerKind: ub4Type kind) ofType: ub4Type. self pointerInitialized: true
allocDescriptorForTimestamp: timestampPointer | xif rtval henv | xif := self session class xif. "timestampPointer contents: (xif OCIDateTime pointerType cast: nil)." henv := self session connection henv. rtval := xif OCIDescriptorAlloc: henv with: timestampPointer with: xif OCI_DTYPE_TIMESTAMP with: 0 with: 0. self session traceLevel >= 1 ifTrue: [(self session traceStream) print: rtval; nextPutAll: ' = OCIDescriptorAlloc( henv ='; nextPutAll: (henv referentAddress printStringRadix: 16); nextPutAll: ', timestampPointer = '; nextPutAll: (timestampPointer referentAddress printStringRadix: 16); nextPutAll: ', type = OCI_DTYPE_TIMESTAMP'; nextPutAll: ' xtramem_sz = 0, usrmempp = 0)'; crtab. self session class trace: self session emitTrace]. rtval == xif OCI_SUCCESS ifFalse: [| errs | errs := self session connection getErrors. ^self session connection class unableToAllocateDescriptorSignal raiseWith: errs errorString: errs first dbmsErrorString].
allocTimestampDescriptor: numElements "Initialize Timestamp Desciptor." | xif timestampPointerPointer timestampPointer | xif := self session connection class xif. ["Begin unwind protection (1)" timestampPointerPointer := xif OCIDateTime pointerType perform: xif mallocSelector with: numElements. 1 to: numElements do:[:index | timestampPointer := timestampPointerPointer refAt: index - 1. self allocDescriptorForTimestamp: timestampPointer ]. "End unwind protection (1)"] ifCurtailed: [ self freeTimestampDescriptor ]. elementSize := timestampPointerPointer sizeof. ^timestampPointerPointer
freeConversionPointers "Free pointers used in the conversion process." yearPointer == nil ifFalse: [ yearPointer freePointer ]. monthPointer == nil ifFalse: [ monthPointer freePointer ]. dayPointer == nil ifFalse: [ dayPointer freePointer ]. hourPointer == nil ifFalse: [ hourPointer freePointer ]. minPointer == nil ifFalse: [ minPointer freePointer ]. secPointer == nil ifFalse: [ secPointer freePointer ]. fsecPointer == nil ifFalse: [ fsecPointer freePointer ]. self pointerInitialized: false
freeDescriptorForTimestamp: timestampPointer | xif rtval | xif := self session class xif. rtval := xif OCIDescriptorFree: timestampPointer contents with: xif OCI_DTYPE_TIMESTAMP. self session traceLevel >= 1 ifTrue: [ (self session traceStream) print: rtval; nextPutAll: ' = OCIDescriptorFree( timestampPointer = '; nextPutAll: (timestampPointer referentAddress printStringRadix: 16); nextPutAll: ', type = OCI_DTYPE_TIMESTAMP)'; crtab. self session class trace: self session emitTrace]. rtval == xif OCI_SUCCESS ifFalse: [| errs | errs := self session connection getErrors. ^self session connection class unableToFreeDescriptorSignal raiseWith: errs errorString: errs first dbmsErrorString]
freeTimestampDescriptor "Free the Timestamp Desciptors." | timestampPointerPointer timestampPointer freeCount | freeCount := count == 0 ifTrue: [1] ifFalse: [count]. timestampPointerPointer := self pointer. 1 to: freeCount do: [:index | timestampPointerPointer datum ifNotNil: [timestampPointer := timestampPointerPointer refAt: index - 1. self freeDescriptorForTimestamp: timestampPointer]]. timestampPointerPointer freePointer
</methods> <methods> Database.OracleTimestampBuffer <category>private-data conversion</category>
at: index putTimestamp: aValue "Store a Timestamp in the buffer." | indexMinus1 bufferAtIndex ts | indexMinus1 := index - 1. aValue isNil ifTrue: [ ^indicatorsPointer at: indexMinus1 put: -1 ]. indicatorsPointer at: indexMinus1 put: 0. lengthsPointer at: indexMinus1 put: elementSize. bufferAtIndex := bufferPointer refAt: indexMinus1. ts := aValue asTimestamp. self constructTimestamp: self session connection hsess err: self session connection herr timestamp: bufferAtIndex year: ts year month: ts month day: ts day hour: ts hour min: ts minute sec: ts second fsec: (ts millisecond*1000000) timezone: 0 timezone_length: 0.
constructTimestamp: hndl err: err timestamp: datetime year: year month: month day: day hour: hour min: min sec: sec fsec: fsec timezone: timezone timezone_length: timezone_length | rtval conn xif | conn := self session connection. xif := conn class xif. rtval := xif OCIDateTimeConstruct: hndl with: err with: datetime contents with: year with: month with: day with: hour with: min with: sec with: fsec with: timezone with: timezone_length. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToConstructTimestampSignal raiseWith: errs errorString: errs first dbmsErrorString ].
getDate: hndl err: err datetime: datetime year: year month: month day: day | rtval conn xif | conn := self session connection. xif := conn class xif. rtval := xif OCIDateTimeGetDate: hndl with: err with: datetime contents with: year with: month with: day. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToGetTimestampDateSignal raiseWith: errs errorString: errs first dbmsErrorString ].
getTime: hndl err: err datetime: datetime hour: hour min: min sec: sec fsec: fsec | rtval conn xif | conn := self session connection. xif := conn class xif. rtval := xif OCIDateTimeGetTime: hndl with: err with: datetime contents with: hour with: min with: sec with: fsec. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToGetTimestampTimeSignal raiseWith: errs errorString: errs first dbmsErrorString ].
getTimestampAt: index "Answer a Timestamp pointed to by the OCIDateTime pointer." | indexMinus1 bp ts hsess herr | (indexMinus1 := index - 1) == 0 ifTrue: [ bp := bufferPointer ] ifFalse: [ bp := bufferPointer refAt: indexMinus1 ]. self pointerInitialized ifFalse: [ self allocateConversionPointers ]. hsess := self session connection hsess. herr := self session connection herr. self getDate: hsess err: herr datetime: bp year: yearPointer month: monthPointer day: dayPointer. self getTime: hsess err: herr datetime: bp hour: hourPointer min: minPointer sec: secPointer fsec: fsecPointer. ts := (Timestamp new) year: yearPointer contents; month: monthPointer contents; day: dayPointer contents; hour: hourPointer contents; minute: minPointer contents; second: secPointer contents; millisecond: (fsecPointer contents/1000000) rounded. ^ts
</methods> <methods> Database.OracleTimestampBuffer <category>allocation</category>
free "Free the external resources held by this buffer." self pointerInitialized ifTrue: [ self freeConversionPointers ]. self freeTimestampDescriptor. super free
mallocForParameter [ "Begin unwind protection" | allocCount numArrays pointerBase | allocCount := (count == 0 ifTrue: [ 1 ] ifFalse: [ count ]). "Allocate a properly typed buffer pointer." bufferPointer := self allocTimestampDescriptor: allocCount. "Allocate for all the remaining arrays in one block." numArrays := 3. indicatorsPointer := self allocShortArray: allocCount * numArrays. pointerBase := indicatorsPointer referentAddress. lengthsPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType. pointerBase := lengthsPointer referentAddress. rcodesPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType. "Allocate the current size holder." count == 0 ifFalse: [ cursizPointer := self allocLong ]. "End unwind protection" ] ifCurtailed: [ self free ]. getSelector := GetSelectorMap at: databaseType ifAbsent: [nil]. setSelector := SetSelectorMap at: databaseType ifAbsent: [nil]
mallocForRowBuffer [ "Begin unwind protection" | allocCount needRcodes numArrays pointerBase | allocCount := (count == 0 ifTrue: [ 1 ] ifFalse: [ count ]). needRcodes := nullsPossible. "Allocate a properly typed buffer pointer." bufferPointer := self allocTimestampDescriptor: allocCount. "Allocate for all the remaining arrays in one block." numArrays := nullsPossible ifTrue: [3] ifFalse: [2]. indicatorsPointer := self allocShortArray: allocCount * numArrays. pointerBase := indicatorsPointer referentAddress. lengthsPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType. pointerBase := lengthsPointer referentAddress. needRcodes ifTrue: [ rcodesPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType ]. "End unwind protection" ] ifCurtailed: [ self free ]. getSelector := GetSelectorMap at: databaseType ifAbsent: [nil]
</methods> <methods> Database.OracleTimestampBuffer <category>accessing</category>
pointerInitialized ^pointerInitialized
pointerInitialized: aBoolean pointerInitialized := aBoolean
</methods> <methods> Database.OracleTimestampBuffer class <category>class initialization</category>
initialize "OracleTimestampBuffer initialize" self install. "Map the Oracle Timestamp datatype codes to get and set functions." GetSelectorMap add: 187 -> #getTimestampAt:. "TIMESTAMP" GetSelectorMap add: 188 -> #getTimestampAt:. "CURRENT_TIMESTAMP" SetSelectorMap add: 187 -> #at:putTimestamp:. "TIMESTAMP"
</methods> <methods> Database.OracleLargeObjectBuffer <category>private-accessing</category>
at: anIndex "Answer the element in the buffer at anIndex." | indexMinus1 rcode | self session answerLobProxy ifFalse: [ ^super at: anIndex. ]. indexMinus1 := anIndex - 1. "rcodesPointer is only allocated if it might need to be checked." rcodesPointer == nil ifFalse: [ rcode := rcodesPointer at: indexMinus1. rcode == 1405 ifTrue: [ ^nil ]. (rcode == 0 or: [rcode == 1406]) ifFalse: "Ignore truncation warnings." [ self session connection class unableToFetchDataSignal raiseWith: (Array with: (OracleError new dbmsErrorCode: rcode)) ] ]. "Nothing went wrong, so fetch the lob proxy." ^self perform: #'getLobProxyAt:' with: anIndex
bufferPointer "Answer the receiver's buffer pointer." ^bufferPointer
pointer "Answer the receiver's LOB locator." ^self lobLocator
</methods> <methods> Database.OracleLargeObjectBuffer <category>private allocation</category>
allocDescriptorForLobLocator: lobLocatorPointer | xif rtval henv | xif := self session class xif. lobLocatorPointer contents: (xif OCILobLocator pointerType cast: nil). henv := self session connection henv. rtval := xif OCIDescriptorAlloc: henv with: lobLocatorPointer with: xif OCI_DTYPE_LOB with: 0 with: 0. self session traceLevel >= 1 ifTrue: [(self session traceStream) print: rtval; nextPutAll: ' = OCIDescriptorAlloc( henv ='; nextPutAll: (henv referentAddress printStringRadix: 16); nextPutAll: ', lobLocatorPointer = '; nextPutAll: (lobLocatorPointer referentAddress printStringRadix: 16); nextPutAll: ', type = OCI_DTYPE_LOB'; nextPutAll: ' xtramem_sz = 0, usrmempp = 0)'; crtab. self session class trace: self session emitTrace]. rtval == xif OCI_SUCCESS ifFalse: [| errs | errs := self session connection getErrors. ^self session connection class unableToAllocateDescriptorSignal raiseWith: errs errorString: errs first dbmsErrorString].
allocLobLocator: numElements "Initialize Lob Locators for an Large Objects (BLOB/CLOB) ." | xif lobLocatorPointerPointer lobLocatorPointer | xif := self session class xif. ["Begin unwind protection (1)" lobLocatorPointerPointer := xif OCILobLocator pointerType perform: xif mallocSelector with: numElements. 1 to: numElements do:[:index | lobLocatorPointer := lobLocatorPointerPointer refAt: index - 1. self allocDescriptorForLobLocator: lobLocatorPointer ]. "End unwind protection (1)"] ifCurtailed: [ 1 to: numElements do: [:index | lobLocatorPointer := lobLocatorPointerPointer refAt: index - 1. self freeDescriptorForLobLocator: lobLocatorPointer ]. lobLocatorPointerPointer freePointer ]. self lobLocator: lobLocatorPointerPointer. ^lobLocatorPointerPointer
freeDescriptorForLobLocator: lobLocatorPointer | xif rtval | xif := self session class xif. rtval := xif OCIDescriptorFree: lobLocatorPointer contents with: xif OCI_DTYPE_LOB. self session traceLevel >= 1 ifTrue: [ (self session traceStream) print: rtval; nextPutAll: ' = OCIDescriptorFree( locatorPtr (lobLocator) = '; nextPutAll: (lobLocatorPointer referentAddress printStringRadix: 16); nextPutAll: ', type = OCI_DTYPE_LOB)'; crtab. self session class trace: self session emitTrace]. rtval == xif OCI_SUCCESS ifFalse: [| errs | errs := self session connection getErrors. ^self session connection class unableToFreeDescriptorSignal raiseWith: errs errorString: errs first dbmsErrorString]
</methods> <methods> Database.OracleLargeObjectBuffer <category>private-data conversion</category>
getBlobAt: index | beginLobLocator resultByteArray readSize | beginLobLocator := self lobLocator. self lobLocator: (beginLobLocator refAt: index -1). readSize := self session defaultDisplayLobSize min: self getLobLength. resultByteArray := (self readFrom: 1 amount: readSize) contents. self lobLocator: beginLobLocator. ^resultByteArray
getClobAt: index ^(self getBlobAt: index) asStringEncoding: self encoding
getPieceAmount: pieceAmount "Answer a ByteArray containing the data in the buffer." | ba | ba := ByteArray new: pieceAmount. bufferPointer copyAt: 0 to: ba size: pieceAmount startingAt: 1. ^ba
setBuffer: aByteArray "Fill the buffer with the value from aByteArray" bufferPointer copyAt: 0 from: aByteArray size: aByteArray size startingAt: 1.
</methods> <methods> Database.OracleLargeObjectBuffer <category>data processing {read}</category>
getChunkSize "get the chunk size." | rtval conn xif herr hsvcctx chunkSizePointer lobLocatorPointer chunkSize | (conn := self getConnection) isNil ifTrue: [ ^nil ]. xif := conn class xif. hsvcctx := conn hsvcctx. herr := conn herr. lobLocatorPointer := self lobLocator contents. ["Begin unwind protection (1)" chunkSizePointer := xif ub4 perform: xif mallocSelector with: 1. chunkSizePointer contents: 0. rtval := xif OCILobGetChunkSize: hsvcctx with: herr with: lobLocatorPointer with: chunkSizePointer. self session traceLevel >= 1 ifTrue: [(self session traceStream) print: rtval; nextPutAll: ' = OCILobGetChunkSize( hsvcctx ='; nextPutAll: (hsvcctx referentAddress printStringRadix: 16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ', lobLocator = '; nextPutAll: (lobLocatorPointer referentAddress printStringRadix: 16); nextPutAll: ', chunkSizePointer = '; nextPutAll: (chunkSizePointer referentAddress printStringRadix: 16); crtab. self session class trace: self session emitTrace]. chunkSize := chunkSizePointer contents. "End unwind protection (1)"] ensure: [ chunkSizePointer == nil ifFalse: [ chunkSizePointer freePointer ] ]. (rtval == xif OCI_SUCCESS or: [ rtval == xif OCI_SUCCESS_WITH_INFO ] ) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToGetLobChunkSizeSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^chunkSize
getLobLength | rtval conn xif herr hsvcctx lengthPointer length lobLocatorPointer | (conn := self getConnection) isNil ifTrue: [ ^nil ]. xif := conn class xif. hsvcctx := conn hsvcctx. herr := conn herr. lobLocatorPointer := self lobLocator contents. ["Begin unwind protection" lengthPointer := xif ub4 perform: xif mallocSelector with: 1. lengthPointer contents: 0. rtval := xif OCILobGetLength: hsvcctx with: herr with: lobLocatorPointer with: lengthPointer. self session traceLevel >= 1 ifTrue: [(self session traceStream) print: rtval; nextPutAll: ' = OCILobGetLength( hsvcctx ='; nextPutAll: (hsvcctx referentAddress printStringRadix: 16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ', lobLocator = '; nextPutAll: (lobLocatorPointer referentAddress printStringRadix: 16); nextPutAll: ', lengthPointer = '; nextPutAll: (lengthPointer referentAddress printStringRadix: 16); crtab. self session class trace: self session emitTrace]. length := lengthPointer contents. "End unwind protection" ] ensure: [ lengthPointer == nil ifFalse: [ lengthPointer freePointer ] ]. (rtval == xif OCI_SUCCESS or: [ rtval == xif OCI_SUCCESS_WITH_INFO ] ) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToGetLobLengthSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^length
readFrom: startingPosition amount: amount | xif conn rtval resultStream amountPointer | (conn := self getConnection) isNil ifTrue: [ ^nil ]. xif := conn class xif. resultStream := ReadWriteStream on: (ByteArray new: amount). amountPointer := amount gcCopyToHeap. [((rtval := self readLobDataExternalFrom: startingPosition amount: amountPointer) == xif OCI_NEED_DATA)] whileTrue: [ resultStream nextPutAll: (self getPieceAmount: amountPointer contents). ] . (rtval == xif OCI_SUCCESS or: [ rtval == xif OCI_SUCCESS_WITH_INFO ] ) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToReadLobDataSignal raiseWith: errs errorString: errs first dbmsErrorString ]. resultStream nextPutAll: (self getPieceAmount: amountPointer contents ). ^resultStream
readLobDataExternalFrom: offset amount: amountPointer "Read a portion of a LOB/FILE as specified by the amountPointer." | rtval conn xif herr hsvcctx lobLocatorPointer | conn := self session connection. xif := conn class xif. hsvcctx := conn hsvcctx. herr := conn herr. lobLocatorPointer := self lobLocator contents. rtval := xif OCILobRead: hsvcctx with: herr with: lobLocatorPointer with: amountPointer with: offset "absolute offset from beginning of data." with: self bufferPointer with: self elementSize with: 0 with: 0 with: 0 with: xif SQLCS_IMPLICIT. self session traceLevel >= 1 ifTrue: [(self session traceStream) print: rtval; nextPutAll: ' = OCILobRead( hsvcctx ='; nextPutAll: (hsvcctx referentAddress printStringRadix: 16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ', lobLocator = '; nextPutAll: (lobLocatorPointer referentAddress printStringRadix: 16); nextPutAll: ', amountPointer = '; nextPutAll: (amountPointer referentAddress printStringRadix: 16); nextPutAll: ' , offset = '; print: offset; nextPutAll: ', bufp = '; nextPutAll: (bufferPointer referentAddress printStringRadix: 16); nextPutAll: ' , bufl = '; print: self elementSize; nextPutAll: ' , ctxp = 0 '; nextPutAll: ' , cbfp = 0 '; nextPutAll: ' , csid = 0 '; nextPutAll: ' , csfrm = SQLCS_IMPLICIT '; crtab. self session class trace: self session emitTrace]. ((rtval == xif OCI_SUCCESS or: [ rtval == xif OCI_SUCCESS_WITH_INFO ]) or: [ rtval == xif OCI_NEED_DATA]) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToReadLobDataSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^rtval
</methods> <methods> Database.OracleLargeObjectBuffer <category>accessing</category>
lobLocator ^lobLocatorHolder value
lobLocator: aLobLocatorPointer lobLocatorHolder value: aLobLocatorPointer
</methods> <methods> Database.OracleLargeObjectBuffer <category>private</category>
getLobProxyAt: index ^self getLobProxyForLocator: (self lobLocator refAt: index -1)
getLobProxyForLocator: aLobLocatorPointerPointer "Initialize Lob Proxy for an Large Objects (BLOB/CLOB) ." | lobProxy | lobProxy := self class proxyClass newForLobLocator: aLobLocatorPointerPointer session: self session lobType: self databaseType. ^lobProxy
</methods> <methods> Database.OracleLargeObjectBuffer <category>allocation</category>
free "Free the external resources held by this buffer." | lobLocatorPointer lobLocatorPointerPointer | lobLocatorPointerPointer := self lobLocator. 1 to: self count do: [:index | lobLocatorPointer := self lobLocator refAt: index - 1. self freeDescriptorForLobLocator: lobLocatorPointer ]. lobLocatorPointerPointer == nil ifFalse: [ lobLocatorPointerPointer freePointer ]. lobLocatorHolder value: nil. super free
mallocForParameter [ "Begin unwind protection" | allocCount pointerBase | allocCount := (count == 0 ifTrue: [ 1 ] ifFalse: [ count ]). self allocLobLocator: allocCount. "Allocate a properly typed buffer pointer." bufferPointer := self allocUnsignedCharArray: allocCount. "Allocate for all the remaining arrays in one block." indicatorsPointer := self allocShortArray: allocCount. pointerBase := indicatorsPointer referentAddress. lengthsPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType. pointerBase := lengthsPointer referentAddress. rcodesPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType. "Allocate the current size holder." count == 0 ifFalse: [ cursizPointer := self allocLong ]. "End unwind protection" ] ifCurtailed: [ self free ]. getSelector := GetSelectorMap at: databaseType ifAbsent: [nil]. setSelector := SetSelectorMap at: databaseType ifAbsent: [nil]
mallocForRowBuffer [ "Begin unwind protection" | allocCount pointerBase needRcodes | allocCount := (count == 0 ifTrue: [ 1 ] ifFalse: [ count ]). needRcodes := nullsPossible. self allocLobLocator: allocCount. "Allocate a properly typed buffer pointer." bufferPointer := self allocUnsignedCharArray: allocCount. "Allocate for all the remaining arrays in one block." indicatorsPointer := self allocShortArray: allocCount * ( needRcodes ifTrue: [ 3 ] ifFalse: [ 2 ] ). pointerBase := indicatorsPointer referentAddress. lengthsPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType. pointerBase := lengthsPointer referentAddress. needRcodes ifTrue: [ rcodesPointer := CPointer new newDatum: pointerBase + (allocCount * 2) ofType: DefaultUnsignedShortPointerType ]. "End unwind protection" ] ifCurtailed: [ self free ]. getSelector := GetSelectorMap at: databaseType ifAbsent: [nil]
</methods> <methods> Database.OracleLargeObjectBuffer <category>data processing {write}</category>
writeLobDataExternalFrom: offset amount: amountPointer piece: piece ^self writeLobDataExternalFrom: offset amount: amountPointer piece: piece bufferLength: self elementSize
writeLobDataExternalFrom: offset amount: amountPointer piece: piece bufferLength: buflen "Read a portion of a LOB/FILE as specified by the amountPointer." | rtval conn xif herr hsvcctx lobLocatorPointer | conn := self session connection. xif := conn class xif. hsvcctx := conn hsvcctx. herr := conn herr. lobLocatorPointer := self lobLocator contents. rtval := xif OCILobWrite: hsvcctx with: herr with: self lobLocator contents with: amountPointer with: offset "absolute offset from beginning of data." with: self bufferPointer with: buflen with: piece with: 0 with: 0 with: 0 with: xif SQLCS_IMPLICIT. self session traceLevel >= 1 ifTrue: [(self session traceStream) print: rtval; nextPutAll: ' = OCILobWrite( hsvcctx ='; nextPutAll: (hsvcctx referentAddress printStringRadix: 16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ', lobLocator = '; nextPutAll: (lobLocatorPointer referentAddress printStringRadix: 16); nextPutAll: ', amountPointer = '; nextPutAll: (amountPointer referentAddress printStringRadix: 16); nextPutAll: ' , offset = '; print: offset; nextPutAll: ', bufp = '; nextPutAll: (bufferPointer referentAddress printStringRadix: 16); nextPutAll: ' , bufl = '; print: self elementSize; nextPutAll: ' , piece = '; print: piece; nextPutAll: ' , ctxp = 0 '; nextPutAll: ' , cbfp = 0 '; nextPutAll: ' , csid = 0 '; nextPutAll: ' , csfrm = SQLCS_IMPLICIT '; crtab. self session class trace: self session emitTrace]. ((rtval == xif OCI_SUCCESS or: [ rtval == xif OCI_SUCCESS_WITH_INFO ]) or: [ rtval == xif OCI_NEED_DATA]) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToWriteLobDataSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^rtval
</methods> <methods> Database.OracleLargeObjectBuffer <category>testing</category>
getConnection | conn | conn := self session connection. conn isConnected ifFalse:[ conn class connectionNotOpenSignal raise. ^nil ]. ^conn
</methods> <methods> Database.OracleLargeObjectBuffer <category>printing</category>
printOn: aStream super printOn: aStream.
</methods> <methods> Database.OracleLargeObjectBuffer <category>initialize-release</category>
columnDescription: colDescr count: allocCount session: aSession | internalType externalType elemSize | internalType := colDescr internalType. "Defaults are to use what given." externalType := internalType. elemSize := colDescr dbsize. nullsPossible := colDescr nullable. self session: aSession. self elementSize: elemSize count: allocCount databaseType: externalType
initialize "Initialize an instance of the receiver." super initialize. lobLocatorHolder := nil asValue. self session: nil
lobFor: value conv: convSymbol count: allocCount | elemSize externalType | nullsPossible := true. elemSize := 4. convSymbol isNil ifTrue: [ externalType := 112. "CLOB"]. convSymbol == #String ifTrue: [ externalType := 112. "CLOB"]. convSymbol == #ByteArray ifTrue: [ externalType := 113. "BLOB"]. self elementSize: elemSize count: allocCount databaseType: externalType
</methods> <methods> Database.OracleLargeObjectBuffer class <category>accessing</category>
proxyClass ^OracleLobProxy
</methods> <methods> Database.OracleLargeObjectBuffer class <category>class initialization</category>
initialize "OracleLargeObjectBuffer initialize" self install. "Map the Oracle LOB datatype codes to get functions." GetSelectorMap add: ( 112 " Character LOB" -> #getClobAt: ); add: ( 113 "Binary LOB" -> #getBlobAt: ).
</methods> <methods> Database.OracleTransaction <category>private-finalization</category>
executor ^self shouldNotImplement
finalizeExternal ^self shouldNotImplement
key ^self shouldNotImplement
</methods> <methods> Database.OracleTransaction <category>private-library calls</category>
acquireExternal ^self
beginExternal ^self
commitExternal ^self
dismissExternal ^self
rollbackExternal ^self
</methods> <methods> Database.OracleTransaction class <category>accessing</category>
connectionClass ^OracleConnection
</methods> <methods> Database.OracleLobProxy <category>accessing</category>
count: anInteger count := anInteger
databaseType: anInteger databaseType := anInteger
defaultBufferSize ^32768 "32K, default buffer size for Large Objects."
elementSize: anInteger elementSize := anInteger
encoding ^self session connection encoding
session: aSession "Use a strong reference to the owning session object, so that it will not finalize before I do. Note that unlike my superclass(es), I can be GC'd independent of the session's control, as well as by my session." session := Array with: aSession
</methods> <methods> Database.OracleLobProxy <category>testing</category>
isBLOB ^self databaseType == 113.
isCLOB ^self databaseType == 112.
</methods> <methods> Database.OracleLobProxy <category>connections</category>
disconnect self free
</methods> <methods> Database.OracleLobProxy <category>printing</category>
printOn: aStream super printOn: aStream.
</methods> <methods> Database.OracleLobProxy <category>data processing {read}</category>
asText self databaseType == 112 ifTrue: [ ^self readAll asText. ].
readAll | bytes | bytes := (self readFrom: 1 amount: (self getLobLength min: self session defaultDisplayLobSize)) contents. self databaseType == 112 ifTrue: [ ^bytes asString. ]. ^bytes.
</methods> <methods> Database.OracleLobProxy <category>initialize-release</category>
initialize "Initialize an instance of the receiver." super initialize. elementSize := self defaultBufferSize. "Default buffer size" count := 1.
</methods> <methods> Database.OracleLobProxy <category>data processing {write}</category>
trimLobTo: length | rtval conn xif herr hsvcctx lobLocatorPointer | (conn := self getConnection) isNil ifTrue: [ ^nil ]. xif := conn class xif. hsvcctx := conn hsvcctx. herr := conn herr. lobLocatorPointer := self lobLocator contents. rtval := xif OCILobTrim: hsvcctx with: herr with: lobLocatorPointer with: length. self session traceLevel >= 1 ifTrue: [(self session traceStream) print: rtval; nextPutAll: ' = OCILobTrim( hsvcctx ='; nextPutAll: (hsvcctx referentAddress printStringRadix: 16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ', lobLocator = '; nextPutAll: (lobLocatorPointer referentAddress printStringRadix: 16); nextPutAll: ', length = '; nextPutAll: (length printStringRadix: 16); crtab. self session class trace: self session emitTrace]. (rtval == xif OCI_SUCCESS or: [ rtval == xif OCI_SUCCESS_WITH_INFO ] ) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToTrimLobDataSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^length
writeFrom: startingPosition with: aByteArray | xif conn rtval bufferSize arraySize amountPointer | conn := self session connection. xif := conn class xif. arraySize := aByteArray size. bufferSize := self elementSize. amountPointer := arraySize gcCopyToHeap. (arraySize <= bufferSize) ifTrue: [ self setBuffer: (aByteArray copyFrom: 1 to: arraySize). rtval := self writeLobDataExternalFrom: startingPosition amount: amountPointer piece: xif OCI_ONE_PIECE. ] ifFalse: [ self setBuffer: (aByteArray copyFrom: 1 to: bufferSize). ((rtval := self writeLobDataExternalFrom: startingPosition amount: amountPointer piece: xif OCI_FIRST_PIECE) == xif OCI_NEED_DATA) ifTrue: [ | beginPosition | beginPosition := bufferSize + 1. [((arraySize - beginPosition + 1) > bufferSize)] whileTrue: [ self setBuffer: (aByteArray copyFrom: beginPosition to: (beginPosition + bufferSize - 1)). rtval := self writeLobDataExternalFrom: startingPosition amount: amountPointer piece: xif OCI_NEXT_PIECE. beginPosition := beginPosition + bufferSize. ]. self setBuffer: (aByteArray copyFrom: beginPosition to: arraySize). rtval := self writeLobDataExternalFrom: startingPosition amount: amountPointer piece: xif OCI_LAST_PIECE bufferLength: (arraySize - beginPosition + 1). ]. ]. (rtval == xif OCI_SUCCESS or: [ rtval == xif OCI_SUCCESS_WITH_INFO ] ) ifFalse: [ | errs | errs := conn getErrors. ^conn class unableToWriteLobDataSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^rtval
</methods> <methods> Database.OracleLobProxy <category>allocation</category>
allocBuffer bufferPointer := self allocStructuredBuffer: 1.
free "Free the external resources held by this lob locator. If the session has not already removed it, remove this lob from the session's weak dictionary, too." | lobLocator | (lobLocator := self lobLocator) isNil ifFalse: [self session dependentLobs removeKey: lobLocator asInteger ifAbsent: []. super free]
</methods> <methods> Database.OracleLobProxy <category>private-finalization</category>
executor "Answer with the executor." | ex | ex := super executor. ex lobLocator: self lobLocator. ^ex
finalize "Release all external resource." self free.
</methods> <methods> Database.OracleLobProxy class <category>initialize-release</category>
newForLobLocator: aLobLocatorPointerPointer session: aSession lobType: anInteger "Initialize Lob Proxy for an Large Objects (BLOB/CLOB) ." | aLobProxy xif conn herr rtval lobLocatorPointerPointer hsvcctx | aLobProxy := self new. aLobProxy databaseType: anInteger. aLobProxy session: aSession. conn := aLobProxy session connection. xif := conn class xif. hsvcctx := conn hsvcctx. herr := conn herr. lobLocatorPointerPointer := xif OCILobLocator pointerType perform: xif mallocSelector with: 1. aLobProxy allocDescriptorForLobLocator: lobLocatorPointerPointer. rtval := xif OCILobLocatorAssign: hsvcctx with: herr with: (aLobLocatorPointerPointer contents) with: lobLocatorPointerPointer. aLobProxy session traceLevel >= 1 ifTrue: [ (aLobProxy session traceStream) print: rtval; nextPutAll: ' = OCILobLocatorAssign( hsvcctx ='; nextPutAll: (hsvcctx referentAddress printStringRadix: 16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix: 16); nextPutAll: ', lobLocator1 = '; nextPutAll: ((aLobLocatorPointerPointer contents) referentAddress printStringRadix: 16); nextPutAll: ', lobLocator2 = '; nextPutAll: (lobLocatorPointerPointer referentAddress printStringRadix: 16); crtab. aLobProxy session class trace: aLobProxy session emitTrace]. rtval == xif OCI_SUCCESS ifFalse: [| errs | errs := conn getErrors. ^conn class unableToAssignLobLocatorSignal raiseWith: errs errorString: errs first dbmsErrorString ]. aLobProxy lobLocator: lobLocatorPointerPointer. aLobProxy allocBuffer. aLobProxy session dependentLobs at: aLobProxy lobLocator asInteger put: aLobProxy. ^aLobProxy
</methods> <methods> Database.OracleAIXInterface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#aix_unix
</methods> <methods> Database.OracleNTInterface <category>constants</category>
ERROR_SUCCESS ^0
HKEY_LOCAL_MACHINE ^16r80000002
REG_EXPAND_SZ ^2
REG_SZ ^1
</methods> <methods> Database.OracleNTInterface <category>parameter</category>
getOracleParameterString: parameterName "Answer the value of the named Oracle parameter, which must be a string. If not present, answer the empty string." | storedKey initialKey key buffer bufferSize count type errorCode parameterString environmentVariable | environmentVariable := super getOracleParameterString: parameterName. (environmentVariable isNil or: [environmentVariable isEmpty]) ifFalse: [^environmentVariable asSymbol]. bufferSize := 256. parameterString := ''. [buffer := CIntegerType char malloc: bufferSize. count := CIntegerType long malloc. type := CIntegerType unsignedLong "dword" malloc. storedKey := CVoidType void pointerType malloc. initialKey := CVoidType void pointerType malloc. initialKey contents: (CVoidType void pointerType cast: self HKEY_LOCAL_MACHINE). key := initialKey. #('SOFTWARE' 'ORACLE') do: [:subKey | errorCode := self regOpenKey: key contents subKey: subKey result: storedKey. errorCode = self ERROR_SUCCESS ifFalse: [^'']. key := storedKey]. count contents: bufferSize. errorCode := self regQueryValueEx: key contents name: parameterName reserved: nil type: type data: buffer size: count. errorCode = self ERROR_SUCCESS ifFalse: [^'']. (type contents = self REG_EXPAND_SZ or: [type contents = self REG_SZ]) ifFalse: [^'']. parameterString := buffer copyCStringFromHeap] valueNowOrOnUnwindDo: [initialKey notNil ifTrue: [initialKey freePointer]. storedKey notNil ifTrue: [storedKey freePointer]. buffer notNil ifTrue: [buffer freePointer]. type notNil ifTrue: [type freePointer]. count notNil ifTrue: [count freePointer]]. ^parameterString
</methods> <methods> Database.OracleNTInterface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#nt
</methods> <methods> Database.OracleColumnDescription <category>initialize-release</category>
initialize precision := 0. scale := 0
</methods> <methods> Database.OracleColumnDescription <category>accessing</category>
oracleInternalType "Answer the internal type of the column, or nil if unknown" ^internalType
tableOwner "Answer the name of the owner of the table that this column belongs to. A nil indicates that the owner name is not known." ^tableOwner
</methods> <methods> Database.OracleColumnDescription <category>private-accessing</category>
dbsize ^dbsize
dbsize: anInteger dbsize := anInteger
internalType ^internalType
internalType: anInteger internalType := anInteger
tableName: aStringOrNil tableName := aStringOrNil
tableOwner: aStringOrNil tableOwner := aStringOrNil
</methods> <methods> Database.OracleColumnDescription <category>private-testing</category>
isLargeObject ^((internalType == 112) or: [internalType == 113]) or: [internalType == 114]
isTimestamp ^internalType == 187 or: [internalType == 188]
</methods> <methods> Database.OracleColumnDescription class <category>instance creation</category>
new ^super new initialize
</methods> <methods> Database.OracleLinux64Interface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#linux_x86_64_unix
</methods> <methods> Database.OracleOS2Interface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#os2
</methods> <methods> Database.OracleWin95Interface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#win95
</methods> <methods> Database.OracleConnection <category>initialize-release</category>
initialize "Establish initial value for instance variables. OracleConnection initialize." super initialize. henvHolder := nil asValue. herrHolder := nil asValue. hsrvrHolder := nil asValue. hsessHolder := nil asValue. htxnHolder := nil asValue. hsvcctxHolder := nil asValue. self transactionMode: #NEW
</methods> <methods> Database.OracleConnection <category>printing</category>
printOn: aStream | hsvcctx | hsvcctx := self hsvcctx. super printOn: aStream. (hsvcctx isNil or: [hsvcctx referentAddress isNil]) ifFalse: [ aStream nextPutAll: '( hsvcctx = '; nextPutAll: (hsvcctx referentAddress printStringRadix: 16); nextPutAll: ' )' ]
</methods> <methods> Database.OracleConnection <category>private-accessing</category>
henv ^henvHolder value
henv: aCPointerOrNil henvHolder value: aCPointerOrNil.
henvHolder ^henvHolder
henvHolder: aValueHolder henvHolder := aValueHolder
herr ^herrHolder value
herr: aCPointerOrNil herrHolder value: aCPointerOrNil.
herrHolder ^herrHolder
herrHolder: aValueHolder herrHolder := aValueHolder
hsess ^hsessHolder value
hsess: aCPointerOrNil hsessHolder value: aCPointerOrNil.
hsessHolder ^hsessHolder
hsessHolder: aValueHolder hsessHolder := aValueHolder
hsrvr ^hsrvrHolder value
hsrvr: aCPointerOrNil hsrvrHolder value: aCPointerOrNil.
hsrvrHolder ^hsrvrHolder
hsrvrHolder: aValueHolder hsrvrHolder := aValueHolder
hsvcctx ^hsvcctxHolder value
hsvcctx: aCPointerOrNil hsvcctxHolder value: aCPointerOrNil.
hsvcctxHolder ^hsvcctxHolder
hsvcctxHolder: aValueHolder hsvcctxHolder := aValueHolder
htxn ^htxnHolder value
htxn: aCPointerOrNil htxnHolder value: aCPointerOrNil.
htxnHolder ^htxnHolder
htxnHolder: aValueHolder htxnHolder := aValueHolder
isolationLevel: newIsolationLevel "Set the current isolation level." (#(#RR #RC #S #RO) includes: newIsolationLevel) ifFalse: [self class unsupportedIsolationLevelSignal raise]. isolationLevel := newIsolationLevel.
transactionMode "Return the current transaction mode." ^transactionMode
transactionMode: newTransactionMode "Set the current transaction mode." (#(#NEW #S #RO) includes: newTransactionMode) ifFalse: [self class unsupportedTransactionModeSignal raise]. transactionMode := newTransactionMode.
</methods> <methods> Database.OracleConnection <category>private-finalization</category>
executor | ex | ex := super executor. ex henvHolder: self henvHolder. ex hsvcctxHolder: self hsvcctxHolder. ex herrHolder: self herrHolder. ex hsrvrHolder: self hsrvrHolder. ex hsessHolder: self hsessHolder. ex htxnHolder: self htxnHolder. ^ex
finalizeExternal | henv | ((henv := self henv) isNil or: [henv referentAddress isNil]) ifTrue: [^self]. traceLevel >= 1 ifTrue: [self class trace: nil]. super finalizeExternal
key "The henvHolder is unique to the connection and is constant across pause/resume." ^self henvHolder
</methods> <methods> Database.OracleConnection <category>accessing</category>
authenticationMode ^authenticationMode
authenticationMode: anInteger authenticationMode := anInteger
encoding "Answer the character set name, and set the encoding in interface class if necessary" | xif nlsEncoding | xif := self class xif. (nlsEncoding := xif encoding) == nil ifTrue: [ nlsEncoding := self getEncoding. nlsEncoding isNil ifTrue: [ nlsEncoding := xif getEncoding ]. xif encoding: nlsEncoding. ]. ^nlsEncoding
executionMode ^executionMode
getErrors "Return a collection of OracleError(s) " "If we don't have an error handle allocated we can only fetch environment errors." ^(self herr isNil ifTrue: [ self getEnvironmentErrors ] ifFalse: [ self getConnectionErrors ]).
</methods> <methods> Database.OracleConnection <category>testing</category>
hasLocaleSupport "Answer true is the loaded OCI has Globalization Support." | xifClass testMethod aHandle resultHandle | xifClass := self class xif class. testMethod := OracleInterface compiledMethodAt:#OCINlsEnvironmentVariableGet:with:with:with:with:. resultHandle := xifClass instanceBehavior libraryFiles detect: [:aLibrary | aHandle := testMethod class mapAddressFor: testMethod library: aLibrary. aHandle notNil] ifNone: [ aHandle := testMethod class mapStaticFor: testMethod ]. resultHandle isNil ifTrue: [ ^false ] ifFalse: [ ^true ]
isNonBlocking ^false
</methods> <methods> Database.OracleConnection <category>private-handle allocation/release</category>
allocHandlePointerExternal: handle type: handleType | rtval xif henv | xif := self class xif. henv := self henv. "Should check if pointer to pointer" rtval := xif OCIHandleAlloc: henv with: handle with: (xif perform: handleType ) with: 0 with: 0. (traceLevel >= 3) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIHandleAlloc( henv = '; nextPutAll: (henv referentAddress printStringRadix: 16); nextPutAll: ', handle = '; nextPutAll: (handle contents referentAddress printStringRadix: 16); nextPutAll: ', type = '; nextPutAll: handleType printString; nextPutAll: ', usermemsize = 0, userdata = 0)'. self class trace: self emitTrace ]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. ^self class unableToAllocateResourceHandleSignal raiseRequestWith: errs errorString: errs first dbmsErrorString ]
freeHandlePointerExternal: handle type: handleType | rtval xif | xif := self class xif. (handle isNil or: [ handle isValid not ] ) ifTrue: [^self ]. rtval := xif OCIHandleFree: handle with: (xif perform: handleType ). (traceLevel >= 3) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIHandleFree( handle = '; nextPutAll: (handle referentAddress printStringRadix: 16); nextPutAll: ', type = '; nextPutAll: handleType printString; nextPutAll: ')'. self class trace: self emitTrace ]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs errCode | errs := self getErrors. (errs isEmpty not and: [ ((errCode := (errs at: 1) dbmsErrorCode ) == 1403) not and: [ (errCode == 22303) not ] ] ) ifTrue: [ ^self class unableToReleaseExternalResourceSignal raiseRequestWith: errs errorString: errs first dbmsErrorString ] ]
</methods> <methods> Database.OracleConnection <category>private-execution</category>
acquireExternal: aPassword "Acquire the external resources involved with a connection to the SQL-environment." | xif name pw env | xif := self class xif. name := self username. [ name isString ] whileFalse: [ name := self class requiredUsernameSignal raiseRequest ]. pw := aPassword. [ pw isString ] whileFalse: [ pw := self class requiredPasswordSignal raiseRequest ]. (env := self environment) isNil ifTrue: [ env := self class defaultEnvironment ]. [ env isString ] whileFalse: [ env := self class requiredEnvironmentSignal raiseRequest ]. env := self class mapLogical: env. [ "Begin unwind protection (1)" "Allocate necessary handles." self unprotectedAllocHenv. ["Begin unwind protection (2)" self serverAttachEnvironmentExternal: env. self setAttribute: self hsrvr type: #OCI_ATTR_SERVER descriptor: self hsvcctx type: #OCI_HTYPE_SVCCTX. ( (name size == 0) and: [ pw size == 0 ]) ifTrue: [ self authenticationMode: xif OCI_CRED_EXT. ] ifFalse: [ self authenticationMode: xif OCI_CRED_RDBMS. self setAttribute: name type: #OCI_ATTR_USERNAME descriptor: self hsess type: #OCI_HTYPE_SESSION . self setAttribute: pw type: #OCI_ATTR_PASSWORD descriptor: self hsess type: #OCI_HTYPE_SESSION. ]. self setAttribute: self htxn type: #OCI_ATTR_TRANS descriptor: self hsvcctx type: #OCI_HTYPE_SVCCTX. self setAttribute: self hsess type: #OCI_ATTR_SESSION descriptor: self hsvcctx type: #OCI_HTYPE_SVCCTX. [ "Begin unwind protection (3)" self sessionBeginExternal "End unwind protection (3)" ] ifCurtailed: [self sessionEndExternal]. "End unwind protection (2)" ] ifCurtailed: [self serverDetachExternal]. "End unwind protection (1)" ] ifCurtailed: [ "Something went wrong so we must implicitly free any handles we've allocated." self unprotectedFreeHenv ]. self singleStatementTransactions
beginExternal "Mark the beginning of receiver's portion of a transaction." | xif rtval hsvcctx herr mode| xif := self class xif. hsvcctx := self hsvcctx. herr := self herr. mode := (Array with: xif OCI_TRANS_NEW with: xif OCI_TRANS_SERIALIZABLE with: xif OCI_TRANS_READONLY) at: (#(#NEW #S #RO) indexOf: self transactionMode). super beginExternal. rtval := xif OCITransStart: hsvcctx with: herr with: 1 with: mode. (traceLevel >= 1) ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCITransStart( hsvcctx = '; nextPutAll: (hsvcctx referentAddress printStringRadix:16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix:16); nextPutAll: ', timeout = 1'; nextPutAll: ', flag = '; nextPutAll: (mode printStringRadix:16). self class trace: self emitTrace]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. ^self class externalDatabaseTransactionErrorSignal raiseWith: errs errorString: errs first dbmsErrorString ]. self multiStatementTransactions
commitExternal | xif rtval hsvcctx herr | xif := self class xif. hsvcctx := self hsvcctx. herr := self herr. super commitExternal ifFalse: [^self]. rtval := xif OCITransCommit: hsvcctx with: herr with: xif OCI_DEFAULT. (traceLevel >= 1) ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCITransCommit( hsvcctx = '; nextPutAll: (hsvcctx referentAddress printStringRadix:16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix:16); nextPutAll: ', OCI_DEFAULT )'. self class trace: self emitTrace]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. ^self class externalDatabaseTransactionErrorSignal raiseWith: errs errorString: errs first dbmsErrorString ]. self singleStatementTransactions
dismissExternal "Release the external resources." [ "Begin unwind protection (1)" self sessionEndExternal. self serverDetachExternal. "End unwind protection (1)" ] ensure: [ "Whether or not there was a failure, there's no point in hanging on to stuff." self unprotectedFreeHenv ]
getAttributeExternal: attributePointer type: attributeType length: attributeLengthPointer descriptor: descriptor type: descriptorType | xif rtval | xif := self class xif. rtval := xif OCIAttrGet: descriptor with: (xif perform: descriptorType ) with: attributePointer with: attributeLengthPointer with: (xif perform: attributeType ) with: self herr. (traceLevel >= 3) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIAttribGet( descriptor = '; nextPutAll: (descriptor referentAddress printStringRadix: 16); nextPutAll: ', descriptorType = '; nextPutAll: descriptorType printString; nextPutAll: ', attribute = '; nextPutAll: (attributePointer referentAddress printStringRadix: 16); nextPutAll: ', attributeType = '; nextPutAll: attributeType printString; nextPutAll: ', length = '; print: attributeLengthPointer contents; nextPutAll: ', herr = '; nextPutAll: (self herr referentAddress printStringRadix: 16); nextPutAll: ')'. self class trace: self emitTrace ]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. ^self class unableToRetrieveDescriptorInfoSignal raiseWith: errs errorString: errs first dbmsErrorString ]
getErrorsExternal: handleOrNil type: errorType at: errorIndex | xif szErrorMsg cbErrorMsgMax rtval error pcbErrorCode | xif := self class xif. [ "Begin unwind protection." cbErrorMsgMax := 512. szErrorMsg := xif OraText perform: xif mallocSelector with: cbErrorMsgMax + 1. pcbErrorCode := CIntegerType long perform: xif mallocSelector with: 1. pcbErrorCode contents: 0. rtval := xif OCIErrorGet: handleOrNil with: errorIndex with: 0 "SqlState not used in this version" with: pcbErrorCode with: szErrorMsg with: cbErrorMsgMax with: (xif perform: errorType ). (rtval == xif OCI_SUCCESS) ifTrue: [ error := self class errorClass new. error dbmsErrorCode: pcbErrorCode contents. error dbmsErrorString: szErrorMsg copyCStringFromHeap. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIErrorGet( handle = *'; nextPutAll: (handleOrNil referentAddress printStringRadix: 16); nextPutAll: ', szSqlState = * , errorCode = '; print: error dbmsErrorCode; nextPutAll: ', errorMsg = '; nextPutAll: error dbmsErrorString; nextPutAll: ', cbErrorMsgMax = '; print: cbErrorMsgMax; nextPutAll: ', errorType = '; nextPutAll: errorType printString; nextPutAll: ' )'; crtab. self class trace: self emitTrace ] ]. "End unwind protection." ] ensure: [ szErrorMsg == nil ifFalse: [ szErrorMsg freePointer ]. pcbErrorCode == nil ifFalse: [ pcbErrorCode freePointer ] ]. ^error
getSchemaObjectAttributeFromDescriptorExternal: hDescriptor type: descriptorType startingAt: position "Retrieve parameter descriptor for the ." | xif rtval paramPointerPointer herr schemaObjectAttribute | xif := self class xif. herr := self herr. ["Begin unwind protection (1)" paramPointerPointer := xif OCIParam pointerType perform: xif mallocSelector with: 1. paramPointerPointer contents: (xif OCIParam pointerType cast: nil ). rtval := xif OCIParamGet: hDescriptor with: (xif perform: descriptorType) with: herr with: paramPointerPointer with: position. (rtval == xif OCI_NO_DATA) ifTrue: [ ^nil ]. (rtval == xif OCI_SUCCESS) ifFalse: [ ^nil ]. schemaObjectAttribute := paramPointerPointer contents. "End unwind protection(1)" ] ensure: [ paramPointerPointer == nil ifFalse: [ paramPointerPointer freePointer ]] . ^schemaObjectAttribute
getSchemaObjectDescriptorExternal: objectPointer size: describeSize kind: describeKind type: describeType "Answer a schema object parameter using a describePointer. A describePointer could be a Qualified String or a REF or a TDO. The describeKind determines which." | xif herr rtval hsvcctx descriptorPointerPointer descriptor | xif := self class xif. hsvcctx := self hsvcctx. herr := self herr. ["Begin unwind protection (1)" descriptorPointerPointer := xif OCIDescribe pointerType perform: xif mallocSelector with: 1. self allocHandlePointerExternal: descriptorPointerPointer type: #OCI_HTYPE_DESCRIBE. ["Begin unwind protection (2)" descriptor := descriptorPointerPointer contents. rtval := xif OCIDescribeAny: hsvcctx with: herr with: objectPointer with: describeSize with: (xif perform: describeKind ) with: 1 with: (xif perform: describeType ) with: descriptor. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. self class unableToDescribeSchemaObjectSignal raiseWith: errs errorString: errs first dbmsErrorString ]. "End unwind protection (2)"] ifCurtailed: [ self freeHandlePointerExternal: descriptor type: #OCI_HTYPE_DESCRIBE ]. "End unwind protection (1)"] ensure: [ descriptorPointerPointer == nil ifFalse: [ descriptorPointerPointer freePointer ] ]. ^descriptor
installExternal "Perform return from snapshot processing." super installExternal. self htxn: nil. self hsrvr: nil. self hsess: nil. self hsvcctx: nil. self herr: nil.
rollbackExternal | xif rtval hsvcctx herr | xif := self class xif. hsvcctx := self hsvcctx. herr := self herr. super rollbackExternal ifFalse: [^self]. rtval := xif OCITransRollback: self hsvcctx with: self herr with: xif OCI_DEFAULT. (traceLevel >= 1) ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCITransRollback( hsvcctx = '; nextPutAll: (hsvcctx referentAddress printStringRadix:16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix:16); nextPutAll: ', OCI_DEFAULT )'. self class trace: self emitTrace]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. ^self class externalDatabaseTransactionErrorSignal raiseWith: errs errorString: errs first dbmsErrorString ]. self singleStatementTransactions
serverAttachEnvironmentExternal: environ "Create an access path to a data source for OCI operations." | rtval xif herr hsrvr | xif := self class xif. self unprotectedAllocHerr. self unprotectedAllocHsvcctx. self unprotectedAllocHsrvr. self unprotectedAllocHsess. self unprotectedAllocHtxn. herr := self herr. hsrvr := self hsrvr. rtval := xif OCIServerAttach:hsrvr with: herr with: environ with: environ size with: (xif OCI_DEFAULT) . (traceLevel >= 1) ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCIAttachServer( hsrvr = '; nextPutAll: (hsrvr referentAddress printStringRadix:16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix:16); nextPutAll: ', environment = '; nextPutAll: environ; nextPutAll: ', size = '; print: environ size; nextPutAll: ', #OCI_DEFAULT )'. self class trace: self emitTrace]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. ^self class unableToConnectToSQLenvironmentSignal raiseWith: errs errorString: errs first dbmsErrorString ].
serverDetachExternal | rtval xif hsrvr herr | xif := self class xif. hsrvr := self hsrvr. herr := self herr. [ "Begin unwind protection (1)" rtval := xif OCIServerDetach: hsrvr with: herr with: xif OCI_DEFAULT. (traceLevel >= 1) ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCIServerDetach( hsrvr = '; nextPutAll: ( hsrvr referentAddress printStringRadix:16); nextPutAll: ', herr = '; nextPutAll: ( herr referentAddress printStringRadix:16); nextPutAll: ', OCI_DEFAULT )'. self class trace: self emitTrace]. "End unwind protection (1)" ] ensure:[ self unprotectedFreeHtxn. self unprotectedFreeHsess. self unprotectedFreeHsrvr. self unprotectedFreeHsvcctx. self unprotectedFreeHerr ].
sessionBeginExternal "Establish a session for a user against a particular server. This call is required for the user to be able to execute any operation on the server." | rtval xif hsvcctx hsess herr | xif := self class xif. herr := self herr. hsvcctx := self hsvcctx. hsess := self hsess. rtval := xif OCISessionBegin: hsvcctx with: herr with: hsess with: self authenticationMode with: xif OCI_DEFAULT. (traceLevel >= 1) ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCISessionBegin( hsvcctx = '; nextPutAll: (hsvcctx referentAddress printStringRadix:16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix:16); nextPutAll: ', hsess = '; nextPutAll: (hsess referentAddress printStringRadix:16); nextPutAll: ', credt = '; print: self authenticationMode; nextPutAll: ', OCI_DEFAULT '; nextPutAll: ')'. self class trace: self emitTrace]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs signal | errs := self getErrors. signal := self class perform: (self class signalMap at: errs first dbmsErrorCode abs ifAbsent: [ #unableToConnectToSQLenvironmentSignal ]). ^signal raiseWith: errs errorString: errs first dbmsErrorString ].
sessionEndExternal | rtval xif hsvcctx hsess herr | xif := self class xif. hsvcctx := self hsvcctx. hsess := self hsess. herr := self herr. rtval := xif OCISessionEnd: hsvcctx with: herr with: hsess with: xif OCI_DEFAULT. (traceLevel >= 1) ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCISessionEnd( hsvcctx = '; nextPutAll: (hsvcctx referentAddress printStringRadix:16); nextPutAll: ', herr = '; nextPutAll: (herr referentAddress printStringRadix:16); nextPutAll: ', hsess = '; nextPutAll: (hsess referentAddress printStringRadix:16); nextPutAll: ', OCI_DEFAULT )'. self class trace: self emitTrace].
setAttributeExternal: attributePointer type: attributeType length: attributeLength descriptor: descriptor type: descriptorType | xif rtval | xif := self class xif. rtval := xif OCIAttrSet: descriptor with: (xif perform: descriptorType ) with: attributePointer with: attributeLength with: (xif perform: attributeType ) with: self herr. (traceLevel >= 3) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIAttribSet( descriptor = '; nextPutAll: (descriptor referentAddress printStringRadix: 16); nextPutAll: ', descriptorType = '; nextPutAll: descriptorType printString; nextPutAll: ', attribute = '; nextPutAll: (attributePointer referentAddress printStringRadix: 16); nextPutAll: ', attributeType = '; nextPutAll: attributeType printString; nextPutAll: ', length = '; print: attributeLength; nextPutAll: ', herr = '; nextPutAll: (self herr referentAddress printStringRadix: 16); nextPutAll: ')'. self class trace: self emitTrace ]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. ^self class unableToQueryHandleInformationSignal raiseWith: errs errorString: errs first dbmsErrorString ]
</methods> <methods> Database.OracleConnection <category>private-attribute accessing</category>
getAttribute: attributeType descriptor: descriptor type: descriptorType | attribute attributeLengthPointer attributePointer getSelector sizeInBytes ub typePointerType xif | [ "Begin unwind protection (1)" xif := self class xif. attributeLengthPointer := xif ub4 perform: xif mallocSelector with: 1. attributeLengthPointer contents: 0. typePointerType := CArrayType defaultPointer referentType: CIntegerType char; numElements: 512. attributePointer := typePointerType perform: xif mallocSelector with: 1. self getAttributeExternal: attributePointer type: attributeType length: attributeLengthPointer descriptor: descriptor type: descriptorType. ub := UninterpretedBytes new: 512. sizeInBytes := attributeLengthPointer contents. (getSelector := AttributeTypeConversionMap at: attributeType ifAbsent: [ #newPointerToAddressAt: ]) == #stringAt: ifTrue: [ | stringPointer | stringPointer := (CIntegerType char pointerType pointerType cast: attributePointer) contents. stringPointer copyAt: 0 to: ub size: sizeInBytes startingAt: 1 ] ifFalse: [ attributePointer copyAt: 0 to: ub size: 4 startingAt: 1]. attribute := ub perform: getSelector with: 1. "End unwind protection (1)"] ensure: [ attributeLengthPointer == nil ifFalse: [ attributeLengthPointer freePointer ]. attributePointer == nil ifFalse: [ attributePointer freePointer ] ]. ^attribute
setAttribute: attribute type: attributeType descriptor: descriptor type: descriptorType | attributeLength attributePointer | [ "Begin unwind protection (1)" ( attribute isString ) ifTrue: [ attributePointer := attribute perform: self class xif copyToHeapSelector. attributeLength := attribute asString size ] ifFalse: [ attributePointer := (attribute isKindOf: Number) ifTrue: [ attribute perform: self class xif copyToHeapSelector ] ifFalse: [ attribute "Attribute is Oracle Handle"]. attributeLength := 0 ]. self setAttributeExternal: attributePointer type: attributeType length: attributeLength descriptor: descriptor type: descriptorType. "End unwind protection (1)"] ensure: [ (attributePointer == nil or: [attributePointer == attribute]) ifFalse: [ attributePointer freePointer ] ]
</methods> <methods> Database.OracleConnection <category>private-handles</category>
privateIsThreadedConnectionLoaded ^(Smalltalk at: #OracleThreadedConnection ifAbsent: []) notNil
unprotectedAllocHenv | xif henvPointerPointer rtval | xif := self class xif. [ "Begin unwind protection (1)" self unprotectedInitLibrary. henvPointerPointer := xif OCIEnv pointerType perform: xif mallocSelector with: 1. rtval := xif OCIEnvInit: henvPointerPointer with: xif OCI_DEFAULT with: 0 with: 0. (traceLevel >= 3) ifTrue: [ (self traceStream) print: rtval; nextPutAll: ' = OCIEnvInit( *henv = '; nextPutAll: (henvPointerPointer contents referentAddress printStringRadix: 16); nextPutAll: ', OCI_DEFAULT, usermemsize = 0, userdata = 0)'. self class trace: self emitTrace ]. (rtval == xif OCI_SUCCESS) ifFalse: [ ^self class unableToInitializeInterfaceLibrarySignal raise ]. "Save environment handle" self henv: henvPointerPointer contents. "End unwind protection (1)." ] ensure: [ henvPointerPointer == nil ifFalse: [ henvPointerPointer freePointer ] ]
unprotectedAllocHerr | xif herrPointerPointer | xif := self class xif. ["Begin unwind protection (1)" herrPointerPointer := xif OCIError pointerType perform: xif mallocSelector with: 1. self allocHandlePointerExternal: herrPointerPointer type: #OCI_HTYPE_ERROR. self herrHolder value: herrPointerPointer contents. "End unwind protection (1)"] ensure: [ herrPointerPointer == nil ifFalse: [ herrPointerPointer freePointer ] ]
unprotectedAllocHsess | xif hsessPointerPointer | xif := self class xif. ["Begin unwind protection (1)" hsessPointerPointer := xif OCISession pointerType perform: xif mallocSelector with: 1. self allocHandlePointerExternal: hsessPointerPointer type: #OCI_HTYPE_SESSION. self hsessHolder value: hsessPointerPointer contents. "End unwind protection (1)"] ensure: [ hsessPointerPointer == nil ifFalse: [ hsessPointerPointer freePointer ] ].
unprotectedAllocHsrvr | xif hsrvrPointerPointer | xif := self class xif. ["Begin unwind protection (1)" hsrvrPointerPointer := xif OCIServer pointerType perform: xif mallocSelector with: 1. self allocHandlePointerExternal: hsrvrPointerPointer type: #OCI_HTYPE_SERVER. self hsrvrHolder value: hsrvrPointerPointer contents. "End unwind protection (1)"] ensure: [ hsrvrPointerPointer == nil ifFalse: [ hsrvrPointerPointer freePointer ] ].
unprotectedAllocHsvcctx | xif hsvcctxPointerPointer | xif := self class xif. ["Begin unwind protection (1)" hsvcctxPointerPointer := xif OCISvcCtx pointerType perform: xif mallocSelector with: 1. self allocHandlePointerExternal: hsvcctxPointerPointer type: #OCI_HTYPE_SVCCTX. self hsvcctxHolder value: hsvcctxPointerPointer contents. "End unwind protection (1)"] ensure: [ hsvcctxPointerPointer == nil ifFalse: [ hsvcctxPointerPointer freePointer ] ].
unprotectedAllocHtxn | xif htxnPointerPointer | xif := self class xif. ["Begin unwind protection (1)" htxnPointerPointer := xif OCITrans pointerType perform: xif mallocSelector with: 1. self allocHandlePointerExternal: htxnPointerPointer type: #OCI_HTYPE_TRANS. self htxnHolder value: htxnPointerPointer contents. "End unwind protection (1)"] ensure: [ htxnPointerPointer == nil ifFalse: [ htxnPointerPointer freePointer ] ].
unprotectedFreeHenv self freeHandlePointerExternal: self henv type: #OCI_HTYPE_ENV
unprotectedFreeHerr self freeHandlePointerExternal: self herr type: #OCI_HTYPE_ERROR
unprotectedFreeHsess self freeHandlePointerExternal: self hsess type: #OCI_HTYPE_SESSION.
unprotectedFreeHsrvr self freeHandlePointerExternal: self hsrvr type: #OCI_HTYPE_SERVER.
unprotectedFreeHsvcctx self freeHandlePointerExternal: self hsvcctx type: #OCI_HTYPE_SVCCTX
unprotectedFreeHtxn self freeHandlePointerExternal: self htxn type: #OCI_HTYPE_TRANS.
unprotectedInitLibrary | xif rtval voidPointerToNil mode cannotFindOracleLibrary | xif := self class xif. cannotFindOracleLibrary := false. self class libraryInitialized ifTrue: [^self]. mode := (self isNonBlocking or: [self privateIsThreadedConnectionLoaded]) ifTrue: [xif OCI_THREADED] ifFalse: [xif OCI_DEFAULT]. [voidPointerToNil := CVoidType void pointerType cast: nil. rtval := xif OCIInitialize: mode with: voidPointerToNil with: 0 with: 0 with: 0] on: self errorSignal do: [:ex | cannotFindOracleLibrary := true. ex return]. cannotFindOracleLibrary ifTrue: ["This error occurs when either the Object Engine has not been linked with the Oracle OCI libraries (Unix, Mac), or the DLLs for those libraries cannot be found in the search path (Windows, OS/2, et al)." ^self class externalDatabaseLibraryInaccessibleSignal raise]. "Issue trace results" traceLevel >= 3 ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCIInitialize(mode = '; nextPutAll: (self isNonBlocking ifTrue: [' OCI_DEFAULT'] ifFalse: [' OCI_THREADED']); nextPutAll: ', usermemsize = 0, userdata = 0)'. self class trace: self emitTrace]. "Follow-up check that library is initialized for access." rtval == xif OCI_SUCCESS ifFalse: [^self class externalDatabaseLibraryInaccessibleSignal raise]. self class libraryInitialized: true
</methods> <methods> Database.OracleConnection <category>private-error accessing</category>
getConnectionErrors "Return a collection of OracleOCIError(s) associated with the connection handle." | errors err errCount | errors := OrderedCollection new. errCount := 1. [(err := self getErrorsExternal: self herr type: #OCI_HTYPE_ERROR at: errCount ) notNil] whileTrue: [ errors add: err. errCount := errCount + 1 ]. ^errors
getEnvironmentErrors "Return a collection of OracleOCIError(s) associated with the environment handle." | errors err errCount | errors := OrderedCollection new. errCount := 1. [(err := self getErrorsExternal: self henv type: #OCI_HTYPE_ENV at: errCount ) notNil] whileTrue: [ errors add: err. errCount := errCount + 1 ]. ^errors
</methods> <methods> Database.OracleConnection <category>data processing</category>
multiStatementTransactions "Take the receiver's connection out of auto-commit mode for transaction behavior." executionMode := #OCI_DEFAULT
singleStatementTransactions "Put the OCI into autocommit mode to give the effect of single-statement transactions." executionMode := #OCI_COMMIT_ON_SUCCESS
</methods> <methods> Database.OracleConnection <category>private-encoding</category>
getEncoding "Answer the character set name from the encoding map dictionary or nil" | charSetName charSetId | self hasLocaleSupport ifTrue: [ self class libraryInitialized ifTrue: [ self unprotectedInitLibrary ]. charSetId := self getNlsCharSetId. charSetName := self getNlsCharSetNameFromId: charSetId. (charSetName isEmpty or: [charSetName = 'NA']) ifTrue: [^#default]. ^self class mapEncodings at: charSetName ifAbsent: [self error: (#errColumnEncoding << #oracleDB >> 'Column encoding not yet recognized')] ] ifFalse: [ ^nil ]
getNlsCharSetId "Answer the character set ID from NLS_LANG." | xif bufPointer rtval sizePointer ub size | xif := self class xif. [ "Begin unwind protection (1)" bufPointer := CIntegerType long perform: xif mallocSelector with: 1. bufPointer contents: 0. sizePointer := CIntegerType long perform: xif mallocSelector with: 1. sizePointer contents: 0. rtval := xif OCINlsEnvironmentVariableGet: bufPointer with: xif OCI_NLS_MAXBUFSZ with: xif OCI_NLS_CHARSET_ID with: 0 with: sizePointer. (traceLevel >= 1) ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCINlsEnvironmentVariableGet( val = '; nextPutAll: (bufPointer referentAddress printStringRadix:16); nextPutAll: ', OCI_NLS_MAXBUFSZ'; nextPutAll: ', OCI_NLS_CHARSET_ID'; nextPutAll: ', 0'; nextPutAll: ' , rsize = '; nextPutAll: (sizePointer referentAddress printStringRadix:16); nextPutAll: ' )'. self class trace: self emitTrace]. (rtval == xif OCI_SUCCESS) ifTrue: [ size := sizePointer contents. ub := UninterpretedBytes new: size. bufPointer copyAt: 0 to: ub size: size startingAt: 1 ]. "End unwind protection (1)"] ensure: [ bufPointer == nil ifFalse: [ bufPointer freePointer ]. sizePointer == nil ifFalse: [ sizePointer freePointer ] ]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. ^self class unableToQueryDriverInformationSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^ub perform: #shortAt: with: 1.
getNlsCharSetNameFromId: charSetId "Answer the Oracle character set name from the specified character set ID." | xif bufPointer bufSize rtval envPointer ub | xif := self class xif. bufSize := xif OCI_NLS_MAXBUFSZ. [ "Begin unwind protection (1)" bufPointer := xif OraText perform: xif mallocSelector with: bufSize + 1. (envPointer := self henv) isNil ifTrue: [ self unprotectedAllocHenv. envPointer := self henv ]. rtval := xif OCINlsCharSetIdToName: envPointer with: bufPointer with: bufSize with: charSetId. (traceLevel >= 1) ifTrue: [(self traceStream) print: rtval; nextPutAll: ' = OCINlsCharSetIdToName( hndl = '; nextPutAll: (envPointer referentAddress printStringRadix:16); nextPutAll: ' , buf = '; nextPutAll: (bufPointer referentAddress printStringRadix:16); nextPutAll: ', buflen = '; print: bufSize; nextPutAll: ', id = '; print: charSetId; nextPutAll: ' )'. self class trace: self emitTrace]. (rtval == xif OCI_SUCCESS) ifTrue: [ ub := UninterpretedBytes new: bufSize. bufPointer copyAt: 0 to: ub size: bufSize startingAt: 1. ]. "End unwind protection (1)"] ensure: [ bufPointer == nil ifFalse: [ bufPointer freePointer ] ]. (rtval == xif OCI_SUCCESS) ifFalse: [ | errs | errs := self getErrors. ^self class unableToQueryDriverInformationSignal raiseWith: errs errorString: errs first dbmsErrorString ]. ^ub perform: #stringAt: with: 1.
</methods> <methods> Database.OracleConnection class <category>class initialization</category>
initialize "OracleConnection initialize" self libraryInitialized: false. self xif: nil. self initializeExternalInterfaceMap. self initializeAttributeTypeConversionMap. self initializeExceptionClasses. self initializeSignalMap. self initializeEncoderMap. self initRegistry.
initializeAttributeTypeConversionMap "OracleConnection initializeAttributeTypeConversionMap." (AttributeTypeConversionMap := IdentityDictionary new) add: #OCI_ATTR_FUNCODE->#unsignedLongAt:; "Environment Handle Attributes:" add: #OCI_ATTR_ENV->#longAt:; add: #OCI_ATTR_CACHE_MAX_SIZE->#unsignedLongAt:; add: #OCI_ATTR_CACHE_OPT_SIZE->#unsignedLongAt:; add: #OCI_ATTR_OBJECT->#unsignedShortAt:; add: #OCI_ATTR_PINOPTION->#unsignedLongAt:; add: #OCI_ATTR_ALLOC_DURATION->#longAt:; add: #OCI_ATTR_PIN_DURATION->#longAt:; "Service Context Handle Attributes:" add: #OCI_ATTR_SQLCODE->#unsignedLongAt:; add: #OCI_ATTR_SERVER->#newPointerToAddressAt:; add: #OCI_ATTR_SESSION->#newPointerToAddressAt:; add: #OCI_ATTR_TRANS->#newPointerToAddressAt:; "Sever Handle Attributes:" add: #OCI_ATTR_SERVER_DBNAME->#stringAt:; add: #OCI_ATTR_CLIENT_DBNAME->#stringAt:; "User Session Handle Attributes:" add: #OCI_ATTR_USERNAME->#stringAt:; add: #OCI_ATTR_PASSWORD->#stringAt:; "Transaction Handle Attributes:" add: #OCI_ATTR_INAME->#stringAt:; add: #OCI_ATTR_XNAME->#stringAt:; add: #OCI_ATTR_XID->#unsignedLongAt:; add: #OCI_ATTR_TRANS_LOCK->#unsignedLongAt:; add: #OCI_ATTR_TRANS_NAME->#stringAt:; "Statement Handle Attributes:" add: #OCI_ATTR_ROW_COUNT->#unsignedLongAt:; add: #OCI_ATTR_ROWS_FETCHED ->#unsignedLongAt:; add: #OCI_ATTR_SQLFNCODE->#unsignedShortAt:; add: #OCI_ATTR_ROWID->#longAt:; add: #OCI_ATTR_PREFETCH_ROWS->#unsignedLongAt:; add: #OCI_ATTR_STMT_TYPE->#unsignedShortAt:; add: #OCI_ATTR_PREFETCH_MEMORY->#unsignedLongAt:; add: #OCI_ATTR_PARSE_ERROR_OFFSET->#unsignedShortAt:; "Type Attributes" add: #OCI_ATTR_REF_TDO->#newPointerToAddressAt:; add: #OCI_ATTR_COLLECTION_TYPECODE ->#longAt:; add: #OCI_ATTR_VERSION ->#stringAt:; add: #OCI_ATTR_COLLECTION_ELEMENT ->#newPointerToAddressAt:; add: #OCI_ATTR_NUM_TYPE_ATTRS ->#unsignedShortAt:; add: #OCI_ATTR_LIST_TYPE_ATTRS ->#newPointerToAddressAt:; add: #OCI_ATTR_NUM_TYPE_METHODS->#unsignedLongAt:; add: #OCI_ATTR_LIST_TYPE_METHODS ->#longAt:; add: #OCI_ATTR_MAP_METHOD ->#longAt:; add: #OCI_ATTR_ORDER_METHOD->#longAt:; "Parameter Attributes" add: #OCI_ATTR_PTYPE->#byteAt:; add: #OCI_ATTR_TIMESTAMP->#stringAt:; add: #OCI_ATTR_NUM_ATTRS->#unsignedShortAt:; add: #OCI_ATTR_NUM_PARAMS->#unsignedShortAt:; add: #OCI_ATTR_PARAM_COUNT->#unsignedLongAt:; add: #OCI_DTYPE_PARAM->#newPointerToAddressAt:; add: #OCI_ATTR_PARAM->#newPointerToAddressAt:; "Type Attribute Attributes" add: #OCI_ATTR_DATA_SIZE->#unsignedShortAt:; add: #OCI_ATTR_DATA_TYPE->#unsignedShortAt:; add: #OCI_ATTR_TYPECODE->#unsignedShortAt:; "For named collections:" add: #OCI_ATTR_COLLECTION_TYPECODE ->#unsignedShortAt:; add: #OCI_ATTR_NUM_ELEMS->#unsignedShortAt:; "Type Attribute Descriptor:" add: #OCI_ATTR_NAME->#stringAt:; add: #OCI_ATTR_PRECISION->#byteAt:; add: #OCI_ATTR_SCALE->#signedByteAt:; add: #OCI_ATTR_IS_NULL->#byteAt:; add: #OCI_ATTR_TYPE_NAME->#stringAt:; add: #OCI_ATTR_SCHEMA_NAME->#stringAt:; add: #OCI_ATTR_REF_TDO->#newPointerToAddressAt:; add: #OCI_ATTR_CHARSET_ID ->#unsignedShortAt:; add: #OCI_ATTR_CHARSET_FORM->#byteAt:
initializeEncoderMap "Initialize the Encoder Map" EncoderMap := Dictionary new. EncoderMap at: 'US7ASCII' put: #ASCII; at: 'JA16EUC' put: #JapaneseEUC; at: 'JA16SJIS' put: #ShiftJIS; at: 'WE8ISO8859P1' put: #ISO8859_1; at: 'EE8ISO8859P2' put: #ISO8859_2; at: 'SE8ISO8859P3' put: #ISO8859_3; at: 'NEE8ISO8859P4' put: #ISO8859_4; at: 'CL8ISO8859P5' put: #ISO8859_5; at: 'AR8ISO8859P6' put: #ISO8859_6; at: 'EL8ISO8859P7' put: #ISO8859_7; at: 'IW8ISO8859P8' put: #ISO8859_8; at: 'WE8ISO8859P9' put: #ISO8859_9; at: 'NE8ISO8859P10' put: #ISO8859_10; at: 'WE8ISO8859P15' put: #ISO8859_15; at: 'WE8ROMAN8' put: #hp_roman8; at: 'US8PC437' put: #ibm437; at: 'EL8PC737' put: #ibm737; at: 'BLT8PC775' put: #ibm775; at: 'WE8PC850' put: #ibm850; at: 'EE8PC852' put: #ibm852; at: 'RU8PC855' put: #ibm855; at: 'TR8PC857' put: #ibm857; at: 'WE8PC860' put: #ibm860; at: 'IS8PC861' put: #ibm861; at: 'IW8PC1507' put: #ibm862; at: 'CDN8PC863' put: #ibm863; at: 'N8PC865' put: #ibm865; at: 'RU8PC866' put: #ibm866; at: 'EL8PC869' put: #ibm869; at: 'AR8ARABICMAC' put: #macarabic; at: 'EE8MACCE' put: #maccenteuro; at: 'EE8MACCROATIAN' put: #maccroatian; at: 'WE8MACROMAN8' put: #macroman; at: 'EL8MACGREEK' put: #macgreek; at: 'IS8MACICELANDIC' put: #maciceland; at: 'CL8MACCYRILLIC' put: #maccyrillic; at: 'IW8MACHEBREW' put: #machebrew; at: 'TR8MACTURKISH' put: #macturkish; at: 'EE8MSWIN1250' put: #'windows-1250'; at: 'CL8MSWIN1251' put: #'windows-1251'; at: 'WE8MSWIN1252' put: #'windows-1252'; at: 'EL8MSWIN1253' put: #'windows-1253'; at: 'TR8MSWIN1254' put: #'windows-1254'; at: 'IW8MSWIN1255' put: #'windows-1255'; at: 'AR8MSWIN1256' put: #'windows-1256'; at: 'BLT8MSWIN1257' put: #'windows-1257'; at: 'VN8MSWIN1258' put: #'windows-1258'; at: 'UTF8' put: #utf_8; at: 'AL24UTFFSS' put: #utf_8.
initializeExceptionClasses "Initialize related exception classes." InvalidAttributeType notifierString: (#inavlidAttributeType << #oracleDB >> 'Invalid attribute type'); nameClass: self message: #invalidAttributeTypeSignal. UnableToAllocateDescriptor notifierString: (#errAllocateDescriptor << #oracleDB >> 'Unable to allocate a descriptor.'); nameClass: self message: #unableToAllocateDescriptorSignal. UnableToAllocateResourceHandle notifierString: (#errAllocateResourceHandle << #oracleDB >> 'Unable to allocate a resource handle.'); nameClass: self message: #unableToAllocateResourceHandleSignal. UnableToAllocateResource notifierString: (#errAllocateResource << #oracleDB >> 'Unable to allocate a resource.'); nameClass: self message: #unableToAllocateResourceSignal. UnableToAssignLobLocator notifierString: (#errAssignLobLocator << #oracleDB >> 'Unable to assign lob locator.'); nameClass: self message: #unableToAssignLobLocatorSignal. UnableToDescribeSchemaObject notifierString: (#unableToDescribeSchemaObject << #oracleDB >> 'Unable to describe schema object.'); nameClass: self message: #unableToDescribeSchemaObjectSignal. UnableToFreeDescriptor notifierString: (#errFreeDescriptor << #oracleDB >> 'Unable to free a descriptor.'); nameClass: self message: #unableToFreeDescriptorSignal. UnableToGetLobChunkSize notifierString: (#errGetLobChunkSize << #oracleDB >> 'Unable to get lob chunk size.'); nameClass: self message: #unableToGetLobChunkSizeSignal. UnableToGetLobLength notifierString: (#errGetLobLength << #oracleDB >> 'Unable to get LOB length.'); nameClass: self message: #unableToGetLobLengthSignal. UnableToInitializeEnvironmentHandle notifierString: (#errInitializeEnvironmentHandle << #oracleDB >> 'Unable to initialize environment handle.'); nameClass: self message: #unableToInitializeEnvironmentHandleSignal. UnableToInitializeInterfaceLibrary notifierString: (#errInitializeInterfaceLibrary << #oracleDB >> 'Unable to initialize interface library.'); nameClass: self message: #unableToInitializeInterfaceLibrarySignal. UnableToLockObjectReference notifierString: (#errLockObjectReference << #oracleDB >> 'Unable to lock object reference.'); nameClass: self message: #unableToLockObjectReferenceSignal. UnableToModifyObjectInfo notifierString: (#unableToModifyObjectInformation << #oracleDB >> 'Unable to modify object information.'); nameClass: self message: #unableToModifyObjectInfoSignal. UnableToReadLobData notifierString: (#errReadLobData << #oracleDB >> 'Unable to read LOB data.'); nameClass: self message: #unableToReadLobDataSignal. UnableToReleaseExternalResource notifierString: (#errFreeExternalResource << #oracleDB >> 'Unable to free an external resource.'); nameClass: self message: #unableToReleaseExternalResourceSignal. UnableToRetrieveDescriptorInfo notifierString: (#errRetrieveDescriptorInformation << #oracleDB >> 'Unable to retrieve descriptor information.'); nameClass: self message: #unableToRetrieveDescriptorInfoSignal. UnableToUnlockObjectReference notifierString: (#errUnlockObjectReference << #oracleDB >> 'Unable to unlock object reference.'); nameClass: self message: #unableToUnlockObjectReferenceSignal. UnableToWriteLobData notifierString: (#errWriteLobData << #oracleDB >> 'Unable to write LOB data.'); nameClass: self message: #unableToWriteLobDataSignal. UnsupportedTransactionMode notifierString: (#unsupportedTransactionMode << #oracleDB >> 'An attempt was made to set an unsupported transaction mode.'); nameClass: self message: #unsupportedTransactionModeSignal. InconsistentDataTypesInArrayBinding notifierString: (#inconsistentDataTypesInArrayBinding << #oracleDB >> 'Inconsistent data types in binding array.'); nameClass: self message: #inconsistentDataTypesInArrayBindingSignal. UnableToTrimLobData notifierString: (#errTrimLobData << #oracleDB >> 'Unable to trim LOB data.'); nameClass: self message: #unableToTrimLobDataSignal.
initializeExternalInterface "Reset Interface with the right interface class based on the current platform." | xifClass | xifClass := self interfaceClass. self xif: (xifClass notNil ifTrue: [xifClass new] ifFalse: [nil]). self privateXif isNil ifTrue: [^Dialog warn: ((#incorrectlyInstalledDriver << #oracleDB >> 'The <1s> Driver is not correctly installed.') expandMacrosWith: self version)].
initializeExternalInterfaceMap "self initializeExternalInterfaceMap" xifMap := IdentityDictionary new. self privateNonThreadedInterfaces do: [:each | xifMap at: (each platformSymbol) put: each name]
initializeSignalMap "OracleConnection initializeSignalMap" signalMap := IdentityDictionary new. signalMap at: 903 put: #invalidTableNameSignal. signalMap at: 942 put: #invalidTableNameSignal. signalMap at: 1408 put: #duplicateIndexesErrorSignal. signalMap at: 1 put: #indexConflictSignal. signalMap at: 54 put: #objectLockedSignal. signalMap at: 1004 put: #authenticationFailureSignal. signalMap at: 1017 put: #authenticationFailureSignal. signalMap at: 1321 put: #couldNotResolveServiceNameSignal. signalMap at: 12154 put: #couldNotResolveServiceNameSignal. signalMap at: 2292 put: #rowIsReferencedErrorSignal. signalMap at: 24344 put: #successWithInformationSignal.
privateNonThreadedInterfaces "Return collection of loaded unthreaded interfaces note - this method depends on the naming convention that threaded interfaces have the word Threaded in them, and non-threaded do not-- e.g. OracleThreadedNTInterface" ^OracleInterface withAllSubclasses select: [:ea | (ea name indexOfSubCollection: 'Threaded' startingAt: 1) == 0]
</methods> <methods> Database.OracleConnection class <category>accessing</category>
is64Bit "Answer true if we are on a 64-bit platform." ^ #(#linux_x86_64_unix #unix_sysV_sun_solaris64) includes: OracleConnection platformType
kind "Answer a symbol representing the type of DBMS the receiver provides services for." ^#'Oracle 8'
libraryInitialized ^libraryInitialized.
libraryInitialized: aBoolean libraryInitialized := aBoolean.
mapEncodings ^EncoderMap
version ^(#relationalVersion << #oracleDB >> 'Database Connect for Oracle 8 - Release 7.0') asString
</methods> <methods> Database.OracleConnection class <category>activation</category>
pause ^self quiesce
resume ^self activate
</methods> <methods> Database.OracleConnection class <category>signal constants</category>
inconsistentDataTypesInArrayBindingSignal "Indicate that inconsistent data types in binding array" ^InconsistentDataTypesInArrayBinding.
invalidAttributeTypeSignal "Invalid attribute type." ^InvalidAttributeType
successWithInformationSignal "Answer the signal to indicate that the action is successful but with a warning." ^SuccessWithInformation.
unableToAllocateDescriptorSignal ^UnableToAllocateDescriptor
unableToAllocateResourceHandleSignal "A handle could not be allocated." ^UnableToAllocateResourceHandle
unableToAllocateResourceSignal "A resource could not be allocated." ^UnableToAllocateResource
unableToAssignLobLocatorSignal ^UnableToAssignLobLocator
unableToConstructTimestampSignal ^UnableToConstructTimestamp
unableToDescribeSchemaObjectSignal "Unable to describe schema object." ^UnableToDescribeSchemaObject
unableToFreeDescriptorSignal ^UnableToFreeDescriptor
unableToGetLobChunkSizeSignal ^UnableToGetLobChunkSize
unableToGetLobLengthSignal ^UnableToGetLobLength
unableToGetTimestampDateSignal ^UnableToGetTimestampDate
unableToGetTimestampTimeSignal ^UnableToGetTimestampTime
unableToInitializeEnvironmentHandleSignal "Indicate that the attempted initialization of the environment handle has failed." ^UnableToInitializeEnvironmentHandle
unableToInitializeInterfaceLibrarySignal "Indicate that the attempted initialization of the interface library has failed." ^UnableToInitializeInterfaceLibrary
unableToLockObjectReferenceSignal "Unable to lock object reference." ^UnableToLockObjectReference
unableToModifyObjectInfoSignal "Unable to modify object information." ^UnableToModifyObjectInfo
unableToReadLobDataSignal ^UnableToReadLobData
unableToReleaseExternalResourceSignal "Unable to free an external resource." ^UnableToReleaseExternalResource
unableToRetrieveDescriptorInfoSignal "Unable to retrieve descriptor information." ^UnableToRetrieveDescriptorInfo
unableToTrimLobDataSignal ^UnableToTrimLobData
unableToUnlockObjectReferenceSignal "Unable to unlock object reference." ^UnableToUnlockObjectReference
unableToWriteLobDataSignal ^UnableToWriteLobData
unsupportedTransactionModeSignal "Answer the signal used to indicate that that an attempt was made to set an unsupported transaction mode." ^UnsupportedTransactionMode
</methods> <methods> Database.OracleConnection class <category>private-accessing</category>
bufferClass "Answer the buffer class for connections/sessions" ^OracleBuffer
columnDescriptionClass "Answer the class to use for column description objects associated with receiver." ^OracleColumnDescription
errorClass "Answer the error class for connections and sessions" ^OracleError
interfaceClass "Answer the correct interface class" | interfaceClassName | interfaceClassName := xifMap at: self platformType ifAbsent: [nil]. ^interfaceClassName notNil ifTrue: [self environment at: interfaceClassName ifAbsent: [nil]] ifFalse: [nil]
privateXif "Answer the xif class instVar without attempting to initialize" ^xif
sessionClass "Answer the class to use for session objects associated with receiver." ^OracleSession
signalMap "Answer the signal map dictionary" ^signalMap
transactionClass "Answer the class to use for transaction objects associated with receiver." ^OracleTransaction
xif "Answer the ExternalInterface subclass instance to use." xif isNil ifTrue: [ self initializeExternalInterfaceMap. self initializeExternalInterface]. ^xif
</methods> <methods> Database.OracleConnection class <category>private-activation</category>
install "This method can be inherrited, and will simply pass the install directive down the chain for those subclasses that need it." self subclasses do: [:each | each install]. "Execute initialization code just once, here." self == OracleConnection ifTrue: [self bufferClass install]. TraceLevel >= 1 ifTrue: [self trace: nil]. self libraryInitialized: false. self xif: nil. self returnFromSnapshot
</methods> <methods> Database.OracleConnection class <category>private-registry</category>
registry ^RegisteredOracleConnections
registry: aCollection RegisteredOracleConnections := aCollection
</methods> <methods> Database.OracleConnection class <category>testing</category>
isThreaded ^false
</methods> <methods> Database.OracleConnection class <category>parcel load/unload/save</category>
postLoadActionFor: aParcel "A Parcel's post-load action must be a class method taking one argument, the Parcel being loaded. Fill-out this template, and accept. Note that you can give the method whatever selector you want. You don't have to stay with postLoadActionFrom:. Note that all loaded classes are sent the message postLoad: after loading. The default implementation, ClassDescription>postLoad: runs the class's initialize method if it has one. One may override this method to add additional loading behavior. See also ClassDescription>preSave: which is intended to be used along with ClassDescription>postLoad: for managing class loading. The post-load action can then ignore class initialization and can instead concentrate on tasks such as opening windows, etc." "If there is no default Database Connect, make this the default." ExternalDatabaseConnection defaultConnection isNil ifTrue: [ ExternalDatabaseConnection defaultConnection: #'Database.OracleConnection' ].
</methods> <methods> Database.OracleMacOSXInterface class <category>private</category>
platformSymbol ^#Power_MacOSX
</methods> <methods> Database.OracleLinuxInterface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#linux_i386_unix
</methods> <methods> Database.OracleAlphaUnixInterface class <category>private</category>
platformSymbol "this must contain the platform symbol that will match that returned by determinePlatformType." ^#alpha_unix
</methods> <methods> Core.Object <category>private-oracle</category>
oracleConversion ^nil
</methods> <methods> Core.String <category>private-oracle</category>
oracleConversion ^#String
</methods> <methods> Core.Integer <category>private-oracle</category>
oracleConversion ^#Integer
</methods> <methods> Core.FixedPoint <category>private-oracle</category>
oracleConversion ^#FixedPoint
</methods> <methods> Core.ByteArray <category>private-oracle</category>
oracleConversion ^#ByteArray
</methods> <methods> Core.SmallInteger <category>private-oracle</category>
oracleConversion ^#Integer32
</methods> <methods> Core.Double <category>private-oracle</category>
oracleConversion ^#Double
</methods> <methods> Core.Timestamp <category>private-oracle</category>
oracleConversion ^#Timestamp
</methods> <methods> Core.UndefinedObject <category>private-oracle</category>
printStringForOracle "Encode receiver in one character using a common Cobol paradigm." ^' '
</methods> <methods> Core.Boolean <category>private-oracle</category>
printStringForOracle "Encode receiver in one character using a common Cobol paradigm." ^self ifTrue: [ 'Y' ] ifFalse: [ 'N' ]
</methods> <methods> Core.Time <category>private-oracle</category>
oracleConversion ^#Timestamp
</methods> <methods> Core.Text <category>private-oracle</category>
oracleConversion ^#String
</methods> <methods> Core.Float <category>private-oracle</category>
oracleConversion ^#Float
</methods> <methods> Core.Date <category>private-oracle</category>
oracleConversion ^#Timestamp
</methods> <methods> Core.OrderedCollection <category>private-oracle-or</category>
oracleConversion ^#OrderedCollection
</methods> <methods> Core.Array <category>private-oracle-or</category>
oracleConversion ^#Array
</methods> <methods> Core.CharacterArray <category>private-oracle-or</category>
oracleConversion ^#String
</methods> <methods> Database.OracleInterface <category>procedures</category>
OCIAttrGet: trgthndlp with: trghndltyp with: attributep with: sizep with: attrtype with: errhp <C: sword OCIAttrGet(const void * trgthndlp, ub4 trghndltyp, void * attributep, ub4 * sizep, ub4 attrtype, OCIError * errhp)> ^self externalAccessFailedWith: _errorCode
OCIAttrSet: trgthndlp with: trghndltyp with: attributep with: size with: attrtype with: errhp <C: sword OCIAttrSet(void * trgthndlp, ub4 trghndltyp, void * attributep, ub4 size, ub4 attrtype, OCIError * errhp)> ^self externalAccessFailedWith: _errorCode
OCIDescribeAny: svchp with: errhp with: objptr with: objnm_len with: objptr_typ with: info_level with: objtyp with: dschp <C: sword OCIDescribeAny(OCISvcCtx * svchp, OCIError * errhp, const OraText * objptr, ub4 objnm_len, ub1 objptr_typ, ub1 info_level, ub1 objtyp, OCIDescribe * dschp)> ^self externalAccessFailedWith: _errorCode
OCIDescriptorAlloc: parenth with: descpp with: type with: xtramem_sz with: usrmempp <C: sword OCIDescriptorAlloc(const void * parenth, void * * descpp, ub4 type, size_t xtramem_sz, void * * usrmempp)> ^self externalAccessFailedWith: _errorCode
OCIDescriptorFree: descp with: type <C: sword OCIDescriptorFree(void * descp, ub4 type)> ^self externalAccessFailedWith: _errorCode
OCIEnvInit: envp with: mode with: xtramem_sz with: usrmempp <C: sword OCIEnvInit(OCIEnv * * envp, ub4 mode, size_t xtramem_sz, void * * usrmempp)> ^self externalAccessFailedWith: _errorCode
OCIErrorGet: hndlp with: recordno with: sqlstate with: errcodep with: bufp with: bufsiz with: type <C: sword OCIErrorGet(void * hndlp, ub4 recordno, OraText * sqlstate, sb4 * errcodep, OraText * bufp, ub4 bufsiz, ub4 type)> ^self externalAccessFailedWith: _errorCode
OCIHandleAlloc: parenth with: hndlpp with: type with: xtramem_sz with: usrmempp <C: sword OCIHandleAlloc(const void * parenth, void * * hndlpp, ub4 type, size_t xtramem_sz, void * * usrmempp)> ^self externalAccessFailedWith: _errorCode
OCIHandleFree: hndlp with: type <C: sword OCIHandleFree(void * hndlp, ub4 type)> ^self externalAccessFailedWith: _errorCode
OCIInitialize: mode with: ctxp with: malocfp with: ralocfp with: mfreefp <C: sword OCIInitialize(ub4 mode, void * ctxp, void * (* malocfp)(void * ctxp, size_t size), void * (* ralocfp)(void * ctxp, void * memptr, size_t newsize), void (* mfreefp)(void * ctxp, void * memptr))> ^self externalAccessFailedWith: _errorCode
OCIParamGet: hndlp with: htype with: errhp with: parmdpp with: pos <C: sword OCIParamGet(const void * hndlp, ub4 htype, OCIError * errhp, void * * parmdpp, ub4 pos)> ^self externalAccessFailedWith: _errorCode
OCIServerAttach: srvhp with: errhp with: dblink with: dblink_len with: mode <C: sword OCIServerAttach(OCIServer * srvhp, OCIError * errhp, const OraText * dblink, sb4 dblink_len, ub4 mode)> ^self externalAccessFailedWith: _errorCode
OCIServerDetach: srvhp with: errhp with: mode <C: sword OCIServerDetach(OCIServer * srvhp, OCIError * errhp, ub4 mode)> ^self externalAccessFailedWith: _errorCode
OCIServerVersion: hndlp with: errhp with: bufp with: bufsz with: hndltype <C: sword OCIServerVersion(void * hndlp, OCIError * errhp, OraText * bufp, ub4 bufsz, ub1 hndltype)> ^self externalAccessFailedWith: _errorCode
OCISessionBegin: svchp with: errhp with: usrhp with: credt with: mode <C: sword OCISessionBegin(OCISvcCtx * svchp, OCIError * errhp, OCISession * usrhp, ub4 credt, ub4 mode)> ^self externalAccessFailedWith: _errorCode
OCISessionEnd: svchp with: errhp with: usrhp with: mode <C: sword OCISessionEnd(OCISvcCtx * svchp, OCIError * errhp, OCISession * usrhp, ub4 mode)> ^self externalAccessFailedWith: _errorCode
</methods> <methods> Database.OracleInterface <category>procedures - transaction</category>
OCITransCommit: svchp with: errhp with: flags <C: sword OCITransCommit(OCISvcCtx * svchp, OCIError * errhp, ub4 flags)> ^self externalAccessFailedWith: _errorCode
OCITransRollback: svchp with: errhp with: flags <C: sword OCITransRollback(OCISvcCtx * svchp, OCIError * errhp, ub4 flags)> ^self externalAccessFailedWith: _errorCode
OCITransStart: svchp with: errhp with: timeout with: flags <C: sword OCITransStart(OCISvcCtx * svchp, OCIError * errhp, uword timeout, ub4 flags)> ^self externalAccessFailedWith: _errorCode
</methods> <methods> Database.OracleInterface <category>procedures - defining</category>
OCIDefineArrayOfStruct: defnp with: errhp with: pvskip with: indskip with: rlskip with: rcskip <C: sword OCIDefineArrayOfStruct(OCIDefine * defnp, OCIError * errhp, ub4 pvskip, ub4 indskip, ub4 rlskip, ub4 rcskip)> ^self externalAccessFailedWith: _errorCode
OCIDefineByPos: stmtp with: defnp with: errhp with: position with: valuep with: value_sz with: dty with: indp with: rlenp with: rcodep with: mode <C: sword OCIDefineByPos(OCIStmt * stmtp, OCIDefine * * defnp, OCIError * errhp, ub4 position, void * valuep, sb4 value_sz, ub2 dty, void * indp, ub2 * rlenp, ub2 * rcodep, ub4 mode)> ^self externalAccessFailedWith: _errorCode
</methods> <methods> Database.OracleInterface <category>procedures - binding</category>
OCIBindByName: stmtp with: bindp with: errhp with: placeholder with: placeh_len with: valuep with: value_sz with: dty with: indp with: alenp with: rcodep with: maxarr_len with: curelep with: mode <C: sword OCIBindByName(OCIStmt * stmtp, OCIBind * * bindp, OCIError * errhp, const OraText * placeholder, sb4 placeh_len, void * valuep, sb4 value_sz, ub2 dty, void * indp, ub2 * alenp, ub2 * rcodep, ub4 maxarr_len, ub4 * curelep, ub4 mode)> ^self externalAccessFailedWith: _errorCode
OCIBindByPos: stmtp with: bindp with: errhp with: position with: valuep with: value_sz with: dty with: indp with: alenp with: rcodep with: maxarr_len with: curelep with: mode <C: sword OCIBindByPos(OCIStmt * stmtp, OCIBind * * bindp, OCIError * errhp, ub4 position, void * valuep, sb4 value_sz, ub2 dty, void * indp, ub2 * alenp, ub2 * rcodep, ub4 maxarr_len, ub4 * curelep, ub4 mode)> ^self externalAccessFailedWith: _errorCode
</methods> <methods> Database.OracleInterface <category>procedures - statement</category>
OCIStmtExecute: svchp with: stmtp with: errhp with: iters with: rowoff with: snap_in with: snap_out with: mode <C: sword OCIStmtExecute(OCISvcCtx * svchp, OCIStmt * stmtp, OCIError * errhp, ub4 iters, ub4 rowoff, const OCISnapshot * snap_in, OCISnapshot * snap_out, ub4 mode)> ^self externalAccessFailedWith: _errorCode
OCIStmtFetch2: stmtp with: errhp with: nrows with: orientation with: fetchOffset with: mode <C: sword OCIStmtFetch2(OCIStmt * stmtp, OCIError * errhp, ub4 nrows, ub2 orientation, sb4 fetchOffset, ub4 mode)> ^self externalAccessFailedWith: _errorCode
OCIStmtFetch: stmtp with: errhp with: nrows with: orientation with: mode <C: sword OCIStmtFetch(OCIStmt * stmtp, OCIError * errhp, ub4 nrows, ub2 orientation, ub4 mode)> ^self externalAccessFailedWith: _errorCode
OCIStmtPrepare: stmtp with: errhp with: stmt with: stmt_len with: language with: mode <C: sword OCIStmtPrepare(OCIStmt * stmtp, OCIError * errhp, const OraText * stmt, ub4 stmt_len, ub4 language, ub4 mode)> ^self externalAccessFailedWith: _errorCode
</methods> <methods> Database.OracleInterface <category>procedures - LOB</category>
OCILobAssign: envp with: errhp with: lobp with: lobpp <C: sword OCILobAssign(OCIEnv * envp, OCIError * errhp, OCILobLocator * lobp, OCILobLocator ** lobpp)> ^self externalAccessFailedWith: _errorCode
OCILobGetChunkSize: svchp with: errhp with: lobp with: chunk_size <C: sword OCILobGetChunkSize(OCISvcCtx * svchp, OCIError * errhp, OCILobLocator * lobp, ub4 * chunk_size)> ^self externalAccessFailedWith: _errorCode
OCILobGetLength: svchp with: errhp with: lobp with: lenp <C: sword OCILobGetLength(OCISvcCtx * svchp, OCIError * errhp, OCILobLocator * lobp, ub4 * lenp)> ^self externalAccessFailedWith: _errorCode
OCILobLocatorAssign: svchp with: errhp with: lobp with: lobpp <C: sword OCILobLocatorAssign(OCISvcCtx * svchp, OCIError * errhp, OCILobLocator * lobp, OCILobLocator ** lobpp)> ^self externalAccessFailedWith: _errorCode
OCILobRead: svchp with: errhp with: lobp with: amtp with: offset with: bufp with: bufl with: ctxp with: cbfp with: csid with: csfrm <C: sword OCILobRead(OCISvcCtx * svchp, OCIError * errhp, OCILobLocator * lobp, ub4 * amtp, ub4 offset, void * bufp, ub4 bufl, void * ctxp, sb4 (* cbfp)(void * ctxp, const void * bufp, ub4 len, ub1 piece), ub2 csid, ub1 csfrm)> ^self externalAccessFailedWith: _errorCode
OCILobTrim: svchp with: errhp with: lobp with: newlen <C: sword OCILobTrim( OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *lobp, ub4 newlen)> ^self externalAccessFailedWith: _errorCode
OCILobWrite: svchp with: errhp with: lobp with: amtp with: offset with: bufp with: buflen with: piece with: ctxp with: cbfp with: csid with: csfrm <C: sword OCILobWrite(OCISvcCtx * svchp, OCIError * errhp, OCILobLocator * lobp, ub4 * amtp, ub4 offset, void * bufp, ub4 buflen, ub1 piece, void * ctxp, sb4 (* cbfp)(void * ctxp, void * bufp, ub4 * len, ub1 * piece), ub2 csid, ub1 csfrm)> ^self externalAccessFailedWith: _errorCode
</methods> <methods> Database.OracleInterface <category>procedures - encoding</category>
OCINlsCharSetIdToName: hndl with: buf with: buflen with: id <C: sword OCINlsCharSetIdToName( void * hndl, oratext *buf, size_t buflen, ub2 id) > ^self externalAccessFailedWith: _errorCode
OCINlsEnvironmentVariableGet: val with: size with: item with: charset with: rsize <C: sword OCINlsEnvironmentVariableGet ( void * val, size_t size, ub2 item, ub2 charset, size_t * rsize )> ^self externalAccessFailedWith: _errorCode
</methods> <methods> Database.OracleInterface <category>procedures - timestamp</category>
OCIDateTimeConstruct: hndl with: err with: datetime with: year with: month with: day with: hour with: min with: sec with: fsec with: timezone with: timezone_length <C: sword OCIDateTimeConstruct ( dvoid *hndl, OCIError *err, OCIDateTime *datetime, sb2 year, ub1 month, ub1 day, ub1 hour, ub1 min, ub1 sec, ub4 fsec, OraText *timezone, size_t timezone_length )> ^self externalAccessFailedWith: _errorCode
OCIDateTimeGetDate: hndl with: err with: datetime with: year with: month with: day <C: sword OCIDateTimeGetDate( dvoid *hndl, OCIError *err, const OCIDateTime *datetime, sb2 *year, ub1 *month, ub1 *day )> ^self externalAccessFailedWith: _errorCode
OCIDateTimeGetTime: hndl with: err with: datetime with: hour with: min with: sec with: fsec <C: sword OCIDateTimeGetTime ( dvoid *hndl, OCIError *err, OCIDateTime *datetime, ub1 *hour, ub1 *min, ub1 *sec, ub4 *fsec )> ^self externalAccessFailedWith: _errorCode
OCIDateTimeGetTimeZoneName: hndl with: err with: datetime with: buf with: buflen <C: sword OCIDateTimeGetTimeZoneName ( dvoid *hndl, OCIError *err, const OCIDateTime *datetime, ub1 *buf, ub4 *buflen)> ^self externalAccessFailedWith: _errorCode
OCIDateTimeSysTimeStamp: hndl with: err with: datetime <C: sword OCIDateTimeSysTimeStamp ( dvoid *hndl, OCIError *err, OCIDateTime *datetime )> ^self externalAccessFailedWith: _errorCode
</methods> <methods> Database.OracleNTInterface <category>procedures</category>
regOpenKey: hk subKey: lpszSubKey result: phkResult <C: long RegOpenKeyA( void *hk, const char *lpszSubKey, void **phkResult)> ^self externalAccessFailedSignal raise
regQueryValueEx: hk name: lpszValueName reserved: lpdwReserved type: lpdwType data: lpbData size: lpcbData <C: long RegQueryValueExA( void *hk, char *lpszValueName, unsigned long *lpdwReserved, unsigned long *lpdwType, unsigned char *lpbData, unsigned long *lpcbData)> ^self externalAccessFailedSignal raise
</methods> <initialize> Database.OracleBuffer </initialize> <initialize> Database.OracleSession </initialize> <initialize> Database.OracleTimestampBuffer </initialize> <initialize> Database.OracleLargeObjectBuffer </initialize> <initialize> Database.OracleConnection </initialize> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>ExternalDatabaseTransaction</name> <environment>Database</environment> <super>Database.ExternalDatabaseFramework</super> <private>false</private> none memberCountHolder remainingCountHolder <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>Integer</name> <environment>Core</environment> <super>Core.Number</super> <private>false</private> none <imports></imports> <category>Magnitude-Numbers</category> <attributes> <package>Magnitude-Numbers</package> </attributes> </class> <class> <name>SmallInteger</name> <environment>Core</environment> <super>Core.Integer</super> <private>false</private> immediate minVal maxVal maxBits maxBytes <imports></imports> <category>Magnitude-Numbers</category> <attributes> <package>Magnitude-Numbers</package> </attributes> </class> <class> <name>Array</name> <environment>Core</environment> <super>Core.ArrayedCollection</super> <private>false</private> objects <imports></imports> <category>Collections-Arrayed</category> <attributes> <package>Collections-Arrayed</package> </attributes> </class> <class> <name>Float</name> <environment>Core</environment> <super>Core.LimitedPrecisionReal</super> <private>false</private> bytes <imports></imports> <category>Magnitude-Numbers</category> <attributes> <package>Magnitude-Numbers</package> </attributes> </class> <class> <name>Date</name> <environment>Core</environment> <super>Core.Magnitude</super> <private>false</private> none day year <imports></imports> <category>Magnitude-General</category> <attributes> <package>Magnitude-General</package> </attributes> </class> <class> <name>CharacterArray</name> <environment>Core</environment> <super>Core.ArrayedCollection</super> <private>false</private> none <imports></imports> <category>Collections-Text</category> <attributes> <package>Collections-Text</package> </attributes> </class> <class> <name>ExternalDatabaseError</name> <environment>Database</environment> <super>Core.Object</super> <private>false</private> none dbmsErrorCode dbmsErrorString osErrorCode osErrorString <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>UndefinedObject</name> <environment>Core</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>ExternalInterface</name> <environment>External</environment> <super>Core.Object</super> <private>false</private> none includeFiles includeDirectories libraryFiles libraryDirectories virtual optimizationLevel <imports> private Kernel.OpcodePool.* </imports> <category>External-Interface</category> <attributes> <package>External-Interface</package> </attributes> </class> <class> <name>Timestamp</name> <environment>Core</environment> <super>Core.Magnitude</super> <private>false</private> none year month day hour minute second millisecond <imports></imports> <category>UIBasics-Support</category> <attributes> <package>UIBasics-Support</package> </attributes> </class> <class> <name>Boolean</name> <environment>Core</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>ExternalDatabaseColumnDescription</name> <environment>Database</environment> <super>Core.Object</super> <private>false</private> none name index type length precision scale nullable <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>Time</name> <environment>Core</environment> <super>Core.Magnitude</super> <private>false</private> none hours minutes seconds <imports></imports> <category>Magnitude-General</category> <attributes> <package>Magnitude-General</package> </attributes> </class> <class> <name>ExternalDatabaseSession</name> <environment>Database</environment> <super>Database.ExternalDatabaseFramework</super> <private>false</private> none connection query queryFragments bindInput bindTemplate bindOutput useNamedOutputBinding bindValues resultTemplate allocateForEachRow blockFactor numColumns columnDescriptions rowAdaptors rowBuffersHolder bufferIndex answerStream currentRow scrollable <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>Double</name> <environment>Core</environment> <super>Core.LimitedPrecisionReal</super> <private>false</private> bytes <imports></imports> <category>Magnitude-Numbers</category> <attributes> <package>Magnitude-Numbers</package> </attributes> </class> <class> <name>ExternalDatabaseConnection</name> <environment>Database</environment> <super>Database.ExternalDatabaseFramework</super> <private>false</private> none transaction username password environment transactionCoordinator cachedSession isolationLevel environmentMap xif xifMap dependents <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>ByteArray</name> <environment>Core</environment> <super>Core.IntegerArray</super> <private>false</private> bytes <imports></imports> <category>Collections-Arrayed</category> <attributes> <package>Collections-Arrayed</package> </attributes> </class> <class> <name>String</name> <environment>Core</environment> <super>Core.CharacterArray</super> <private>false</private> none <imports></imports> <category>Collections-Text</category> <attributes> <package>Collections-Text</package> </attributes> </class> <class> <name>ExternalDatabaseBuffer</name> <environment>Database</environment> <super>Core.Object</super> <private>false</private> none databaseType encoding elementSize count bufferPointer <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>OrderedCollection</name> <environment>Core</environment> <super>Core.SequenceableCollection</super> <private>false</private> objects firstIndex lastIndex <imports></imports> <category>Collections-Sequenceable</category> <attributes> <package>Collections-Sequenceable</package> </attributes> </class> <class> <name>Text</name> <environment>Core</environment> <super>Core.CharacterArray</super> <private>false</private> none string runs <imports> private Graphics.TextConstants.* </imports> <category>Collections-Text</category> <attributes> <package>Collections-Text</package> </attributes> </class> <class> <name>FixedPoint</name> <environment>Core</environment> <super>Core.Number</super> <private>false</private> none numerator denominator scale <imports></imports> <category>Magnitude-Numbers</category> <attributes> <package>Magnitude-Numbers</package> </attributes> </class> <class> <name>ExternalDatabaseException</name> <environment>Database</environment> <super>Core.Error</super> <private>false</private> none <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class>