2015-05-05 Version 4.1.0 Vincent Rogier vince.rogier@ocilib.net * C API - Major library code update: * All public functions entry and exit points have been rewritten in order to satisfy requirements of the OCI_ENV_CONTEXT environment flag * Fixed some functions that were not setting context result properly when using OCI_ENV_CONTEXT flag * various internal code updates and minor fixes * OCI_EnableWarnings() and OCI_SetErrorHandler() are now return a boolean values * Factorized internal OCILIB objects clean up in various places - Enhanced implicit string conversion for Date, Timestamps and Numeric values * Conversion formats can be now set at both library and connection level - The library is using its own default format if none are set - Program can define formats at library level - Program can define formats for a specific connection * It is now possible define specific conversion formats for: - OCI_Date - OCI_Timestamp - All Numeric types - Binary double - Binary float * Added new methods: - OCI_SetFormat() - OCI_GetFormat() * Removed the following methods that are now defined as macros for backward compatibility reasons: - OCI_SetDefaultFormatDate() - OCI_GetDefaultFormatDate() - OCI_SetDefaultFormatNumeric() - OCI_GetDefaultFormatNumeric() - Fixes * Fixed compilation under oracle 11gR1 caused by wrong oracle version checking in the file pool.c * Fixed few warnings raised by Clang C compiler * Fixed Binary Float implicit conversion to string when using Oracle 12g * Fixed UTF8 strings bytes size computing when passing them to Oracle client * Fixed binding double and float when Oracle client >= 10.1 and Oracle Server < 10.1 (usage of binary_double and binray_float supported by the client from 10gR1 but not supported by Oracle 8i and 9i) * Fixed memory leak in internal method OCI_StringFromStringPtr() used in OCI_ElemGetString() and OCI_ObjectGetString() * Fixed possible memory retention related to OCI Object cache (depending on the Oracle Client version) - Warning : Programs must be recompiled (with no code change needed) as some methods have been removed from the library * C++ API - Enhancements * Added abstract Streamable class: - It allows derived classes to be compatible with any external stream class supporting the operator << (std::(w)string) - The following classes derives now from Streamable : Date, Interval, Timestamp, Collection, Object and Reference * Added Support for the enhancements made to the string conversion format in the C API: - Added Enum FormatType - Added Environment::GetFormat() and Environment::SetFormat() - Added Connection::GetFormat() and Connection::SetFormat() - Removed Connection::SetDefaultDateFormat() and Connection::GetDefaultDateFormat() - Removed Connection::SetDefaultNumericFormat() and Connection::GetDefaultNumericFormat() * Added support for Clang C++ compiler * Statement::Bind<>(): Added specializations for Collection and std::vector> instead of relying on default the implementation that is now removed * Added parametrized constructors for Date, Interval and Timestamp classes * Made sure that translation from C raw buffer to the C++ Raw class does not fail in case of NULL buffers with non zero size parameter * Modified internal access to environment singleton object instance * Added enum values for Oracle Versions * Added new template methods to Resultset class - Get() : template method allowing to return a user defined type from a resultset current row content using a translator user defined method/functor/lambda (e.g. return an user defined struct/class from a select on a table) - ForEach() : convenient method wrapping the while(rs.Next)) pattern and that call the an user defined method/functor/lambda for each row fetched - ForEach() : version of ForEach and Get combined - See the updated main demo application for examples * Added template methods Statement::Execute() and Statement::ExecutePrepared(): - theses overloaded methods can take fetch callbacks and also datatype adater callbacks - It makes the code much compact as it hides the resultset fetch calls - It also allow adapting resultsets returned values to user defined types - See the updated main demo application for examples * Added Resultset::Get<>() overloads with input value arguments to fill instead of returning values. This allow to no specify the data type in the Get<>() call. - void Get(unsigned int, TDataType &value) const - void Get(const ostring &name, TDataType &value) const; - Changes: * Exception class does not derive any more from HandleHolder<> * Date::SysDate() is now a static method that returns a now a Date Object with system date time * Timestamp::SysTimestamp() is now a static method that returns a now a Timestamp Object with system timestamp * Renamed Statement::Execute(void) to ExecutePrepared(void) * Added default constructors for classes holding datatypes. - Using the default constructor, we have objects holding no C handles - - Their IsNull() properties return is true. - They can now be stored in structures and classes without the need of passing parameters - Their initialization can be deferred from declaration using function return values or using their class constructor with class name - Fixes * Fixed missing operator "|" for recently Enum promoted to Flags * Fixed HandleHolder<>::operator bool * Fixed Statement::Prepare() and Statement::Execute() : when called again for the same object, the internal map of binds was not cleared although bind objects were freed, leading to a segfault * Fixed Statement::Bind : strings binded to statements with Out or InOut direction mode had their content padded up to max provided size after execution * Fixed C++03 standard violation : Removed usage of std::vector::data() that was introduced in C++11 in order to be compliant with C++03 * Fixed Timestamp::SetDate() * Removed unimplemented prototype Lob:: operator TLobObjectType() * Fixed segfault when Environment::Initialize() fails to load the oci shared library - C++ compilers validated versions: * Microsoft C++ compiler : all versions from Visual Studio 2008 * GCC : all versions from 4.1 * Clang : all versions from 3.1 * OCILIB++ shall also compile with older versions of these compilers and with other C++ compilers, but not tested - Miscellaneous * Internal code clean up * Updated some demo files