📄 otl3_whatn.htm
字号:
were introduced to support Oracle 9i's TMESTAMP dadatype under #define <a
href="otl3_compile.htm#otl_ORA7">OTL_ORA7</a>, This release introduces
support for same #defines for OTL/OCIx where x >= 9 for easier
migration of OTL legacy apps that use OTL_ORA7 to more recent OCIs
(9.x, 10.x, 11.x). In example <a href="otl4_ex473.htm">473</a>,
#define <a href="otl3_compile.htm#OTL_ORA7">OTL_ORA7</a> can be
replaced with <a href="otl3_compile.htm#OTL_ORA9I">OTL_ORA9I</a>, <a
href="otl3_compile.htm#OTL_ORA10G">OTL_ORA10G</a>, <a
href="otl3_compile.htm#OTL_ORA10G_R2">OTL_ORA10G_R2</a>, or <a
href="otl3_compile.htm#OTL_ORA11G">OTL_ORA11G</a>.<br>
<br>
</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align: top;">New (in OTL 4.0.169):<br>
<br>
<ul>
<li>When #define <a href="otl3_compile.htm#OTL_ORA_UTF8">OTL_ORA_UTF8</a>
is enabled, OTL may truncate a string value, for example:<font
face="Arial" size="2">'schwarz+weiß' gets truncated to </font><font
face="Arial" size="2">'schwarz+wei' on a SELECT statement. OTL
allocated the size of described VARCHAR / NVARCHAR columns in bytes,
which was not sufficient to hold multibyte UTF8 characters that were
stored as single bytes in the database. On the
database side, character '</font><font face="Arial" size="2">ß'
is stored in one byte in the case if the database character set is
"8-bit European", and the client / C++ side's is UTF8, it requires 2
bytes. If the database character set is UTF8, then there is no such
problem. The problem has been fixed in this release<br>
<br>
</font></li>
<li><font face="Arial" size="2">A compilation problem was
reported for an unspecified version of Informix for Linux when #define <a
href="otl3_compile.htm#OTL_INFORMIX_CLI">OTL_INFORMIX_CLI</a> is
enabled. I asked the guy (presumably someone from P.R.C.) who reported
the problem to email me his version of the Informix header files and
object libraries. He emailed me everything, I fixed the problem,
emailed him the patch, but I haven't heard from him since.<br>
<br>
The compilation bug has been fixed in this release. <br>
<br>
</font></li>
<li><font face="Arial" size="2">A problem was reported that
when example <a href="otl4_ex378.htm">378</a> (for Oracle 8.x and
higher) is rewritten to use #define <a
href="otl3_compile.htm#OTL_UNICODE">OTL_UNICODE</a>, <a
href="otl3_long_string.htm">otl_long_unicode_string</a>, and
std::wcout, the output looks like this:<br>
</font>
<pre wrap=""> f1=1<br> chunk #1, f2=*?, len=4001<br> f1=2<br> chunk #1, f2=##, len=6000<br> chunk #2, f2=# , len=12000<br> chunk #3, f2=# , len=12000<br> chunk #4, f2=# , len=-9996<br> f1=3<br> chunk #1, f2=*?, len=4001</pre>
It's obviously incorrect. The bug reporter also sent me a fix along
with the bug report. The fix has been merged into this release.<br>
<font face="Arial" size="2"><br>
</font></li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align: top;">New (in OTL 4.0.168):<br>
<br>
<ul>
<li>Some projects need to be able to connect to multiple
database types at the same time via ODBC. For example, to MySQL and
TimesTen, or to MS SQL 2005 and Sybase. OTL has specific #define's for
some database types (like #define OTL_ODBC_MSSQL_2005, or #define
OTL_ODBC_POSTGRESQL, etc.), which makes it impossible to connect to
multiple database types at the same time. In order to address the
issue, this release introduces #define <a
href="otl3_compile.htm#OTL_ODBC_MULTI_MODE">OTL_ODBC_MULTI_MODE</a>,
and otl_connect::<a href="otl3_connect_class.htm#set_connection_mode">set_connection_mode</a>().
For more detail, see example <a href="otl4_ex675.htm">675</a>.<br>
<br>
</li>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align: top;">New (in OTL 4.0.167):<br>
<br>
<ul>
<li>In this release or higher, #define <a
href="otl3_compile.htm#OTL_UNCAUGHT_EXCEPTION_OWN_NAMESPACE">OTL_UNCAUGHT_EXCEPTION_OWN_NAMESPACE</a>
is obsolete. The underlying problem when OTL gets compiled with
#define <a href="otl3_compile.htm#OTL_STLPORT">OTL_STLPORT</a> has
been fixed.
It's recommended to comment out
#define.OTL_UNCAUGHT_EXCEPTION_OWN_NAMESPACE.<br>
<br>
</li>
<li>Some project still use Visual C++ 6.0. <a
href="#162_UNCAUGHT">OTL 4.0.162</a> made #define <a
href="otl3_compile.htm#OTL_UNCAUGHT_EXCEPTION_ON">OTL_UNCAUGHT_EXCEPTION_ON</a>
the default. VC 6.0's std::uncaught_exception() always returns true,
meaning that it doesn't work the way the C++ standard defines. This
release stops enabling #define OTL_UNCAUGHT_EXCEPTION_ON for VC
6.0 for backward compatibility in order to allow the OTL based
projects that are stiil using VC 6.0 to continue to work.<br>
<br>
</li>
<li>This release introduces basic support for DB2 XML, MS SQL
XML, and Oracle XMLType datatypes. For more detail, see the following
code examples:<br>
<br>
</li>
<ul>
<li>Oracle: <a href="otl4_ex659.htm">659</a>, <a
href="otl4_ex660.htm">660</a>, <a href="otl4_ex661.htm">661</a>, <a
href="otl4_ex662.htm">662</a><br>
</li>
<li>Oracle UTF-8: <a href="otl4_ex663.htm">663</a>, <a
href="otl4_ex664.htm">664</a><br>
</li>
<li>DB2: <a href="otl4_ex671.htm">671</a>, <a
href="otl4_ex672.htm">672</a><br>
</li>
<li>DB2 Unicode: <a href="otl4_ex673.htm">673</a>, <a
href="otl4_ex674.htm">674</a><br>
</li>
<li>MS SQL: <a href="otl4_ex665.htm">665</a>, <a
href="otl4_ex666.htm">666</a><br>
</li>
<li>MS SQL Unicode: <a href="otl4_ex669.htm">669</a>, <a
href="otl4_ex670.htm">670</a><br>
</li>
<li>MS SQL with FreeTDS: <a href="otl4_ex667.htm">667</a>,
<a href="otl4_ex668.htm">668</a><br>
<br>
</li>
</ul>
<li>This release compiles clean with g++ 4.3.0 when the
following command line options are enabled:<br>
<br>
</li>
<ul>
<li>-Wshadow <br>
</li>
<li>-Wall <br>
</li>
<li>-Wundef <br>
</li>
<li>-Wpointer-arith<br>
</li>
<li>-Wunused <br>
</li>
<li>-Wreorder <br>
</li>
<li>-Wcast-qual <br>
</li>
<li>-Wno-uninitialized<br>
</li>
<li>-Wcast-align<br>
</li>
<li>-Wconversion<br>
</li>
<li>-Wsign-compare<br>
</li>
<li>-Werror<br>
</li>
<li>-Wwrite-strings <br>
</li>
<li>-Wcomments <br>
</li>
<li>-Wunused-variable <br>
</li>
<li>-Wparentheses<br>
</li>
<li>-ansi <br>
</li>
<li>-Wformat <br>
</li>
<li>-Wstrict-aliasing=2 <br>
</li>
<li>-Wstrict-null-sentinel<br>
</li>
<li>-fstrict-aliasing <br>
</li>
<li>-Wold-style-cast <br>
</li>
<li>-Woverloaded-virtual<br>
</li>
<li>-Wctor-dtor-privacy <br>
</li>
<li>-Wnon-virtual-dtor<br>
</li>
<li>-Wsign-promo<br>
</li>
<li>-Wextra<br>
</li>
<li>-Wfloat-equal <br>
</li>
<li>-Wmissing-noreturn <br>
</li>
<li>-Wmissing-format-attribute <br>
</li>
<li>-Weffc++<br>
<br>
</li>
</ul>
<li>This release has been reworked to compile clean with
g++'s -Weffc++. effc++ warns about violations of the following style
guidelines from Scott Meyers™ Effective C++ book:<br>
<br>
</li>
<ul>
<li>Item 6: Distinguish between prefix and postfix forms of
increment and decrement operators.</li>
<li>Item 7: Never overload operators "&&", "||", or
",".</li>
<li>Item 11: Define a copy constructor and an assignment
operator for classes with dynamically allocated memory.</li>
<li>Item 12: Prefer initialization to assignment in
constructors.</li>
<li>Item 14: Make destructors virtual in base classes.</li>
<li>Item 15: Have "operator=" return a reference to *this.</li>
<li>Item 23: Don't try to return a reference when you must
return an object.<br>
<br>
<br>
</li>
</ul>
</ul>
</td>
</tr>
<tr>
<td style="vertical-align: top;">New (in OTL 4.0.166):<br>
<br>
<ul>
<li>A bug was reported that otl_connect::<a
href="otl3_connect_class.htm#rollback">rollback</a>() has no effect
when OTL is used in a combination with FreeTDS/ODBC against MS SQL. It
turned out that
the feature wasn't implemnted in FreeTDS/ODBC. In order to work around
the problem, this release introduces #define <a
href="otl3_compile.htm#OTL_FREETDS_ODBC_WORKAROUNDS">OTL_FREETDS_ODBC_WORKAROUNDS</a>.
See <a href="otl4_mssql_freetds_examples.htm">MS SQL Server / FreeTDS
ODBC</a> examples for more detail. The new #define is recommended for
use until a fix becomes available.<br>
<br>
FreeTDS/ODBC seems to have a similar problem with
otl_connect::rlogon()'s
auto-commit with Sybase. However, the new #define is not recommended as
a
workaround for Sybase, because otl_connect::<a
href="otl3_connect_class.htm#auto_commit_off%28%29">auto_commit_off</a>()
and otl_connect::<a href="otl3_connect_class.htm#auto_commit_on">auto_commit_on</a>()
functions seem to work with Sybase. Until a fix becomes available,
auto_commit_on() / auto_commit_off() are recommended for use. See for <a
href="otl4_sybsql_freetds_examples.htm">Sybase
SQL Server / FreeTDS ODBC</a> examples more detail.<br>
<br>
Also, FreeTDS/ODBC doesn't seem to support "transaction isolation"
level, that
is, otl_connect::<a
href="otl3_connect_class.htm#set_transaction_isolation_level">set_transaction_isolation_level</a>()
has no effect. Until the feature is implemented in FreeTDS/ODBC, it's
recommended that explicit server side settings should be used instead.
For example, MS SQL supports an explicit (NOLOCK) option on the FROM
clause in a SELECT statement. Sybase has the "set transaction isolation
level X" command to set an explicit, session-wide transaction isolation
level. For more detail, see examples <a href="otl4_ex516.htm">516</a>
(MS SQL), and <a href="otl4_ex561.htm">561</a> (Sybase).<br>
<br>
Many thanks to James Lowden the
maintainer of FreeTDS for clarifying the issues. More issues may be
uncovered as more developers begin using OTL with FreeTDS/ODBC. I'd
recommend those developers to subsribe to the FreeTDS mailing list to
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -