オリジナル版:http://lists.mysql.com/java/9089
MySQL Connector/J 5.1.1(MySQL用のタイプ4のpure-Java JDBCドライバの新アルファバージョン)が リリースされました。
バージョン5.1.1は、MySQL-4.1、MySQL-5.0、MySQL-5.1ベータ版、MySQL-5.2ファルコンプレビュー用を含んだいくつかのMySQLのバージョンでの使用にふさわしいリリースです。
バージョン5.1.1は、http://dev.mysql.com/downloads/connector/j/5.1.htmlおよびミラーサイトのConnector/Jダウンロードページからソースおよびバイナリ形式で入手可能です。(すべてのミラーサイトが現在において最新であるとは限らないかもしれないことに注意してください。あるミラーサイトでこのバージョンを見つけることができない場合は、再度確認を行うか、あるいは別のダウンロード・サイトを選択してください。)
いつものことですが、アプリケーションに影響を及ぼす動作変更を把握するには、アップグレードの前に、マニュアルの変更ログ(http://dev.mysql.com/doc/refman/5.0/en/cj-news.html)と"Upgrading"の節(http://dev.mysql.com/doc/refman/5.0/en/cj-upgrading.html)をチェックするようお勧めします。
バグレポート、バグ修正、パッチ等の情報をお待ちしておりますので、以下のページをご利用ください。
http://forge.mysql.com/wiki/Contributing
以下はこのリリースのパフォーマンス改善、機能の追加および変更情報です。
このリリースからのフィードバックに基づき近々リリース予定のベータ版リリースとともに、バージョン5.1.1は、新たなJDBC-4.0 APIを実施した最新の試作品です。
他の試作リリースと同様、このアルファリリースは、製品レベルのシステムあるいはクリティカルなデータをもつシステム上でインストールしないでください。いかなるソフトウェアの新バージョンをインストールする前でも、バックアップをとることが望ましいです。MySQL AB社は、ハイレベルの品質を保証すべく、非常に努力してきましたが、いかなるソフトウェア試作リリースにおいてと同様、バックアップを行なうことによりデータの保護を行なってください。
以下は本製品の新たな特徴です。
* Pulled vendor-extension methods of Connection implementation out into an interface to
support java.sql.Wrapper functionality from ConnectionPoolDataSource. The vendor
extensions are javadoc'd in the com.mysql.jdbc.Connection interface.
For those looking further into the driver implementation, it is not an API that is
used for plugability of implementations inside our driver (which is why there are still
references to ConnectionImpl throughout the code).
Incompatible change: Connection.serverPrepare(String) has been re-named
to Connection.serverPrepareStatement() for consistency with
Connection.clientPrepareStatement().
We've also added server and client prepareStatement() methods that cover all of the
variants in the JDBC API.
* Similar to Connection, we pulled out vendor extensions to Statement into an interface
named "com.mysql.Statement", and moved the Statement class into com.mysql.StatementImpl.
The two methods (javadoc'd in "com.mysql.Statement" are enableStreamingResults(), which
already existed, and disableStreamingResults() which sets the statement instance
back to the fetch size and result set type it had before enableStreamingResults() was
called.
* Added experimental support for statement "interceptors" via the
com.mysql.jdbc.StatementInterceptor interface, examples are in
com/mysql/jdbc/interceptors.
Implement this interface to be placed "in between" query execution, so that you can
influence it. (currently experimental).
StatementInterceptors are "chainable" when configured by the user, the results
returned by the "current" interceptor will be passed on to the next on in the chain, from
left-to-right order, as specified by the user in the JDBC configuration property
"statementInterceptors".
See the sources (fully javadoc'd) for com.mysql.jdbc.StatementInterceptor for more
details until we iron out the API and get it documented in the manual.
* Externalized the descriptions of connection properties.
* The data (and how it's stored) for ResultSet rows are now behind an interface which
allows us (in some cases) to allocate less memory per row, in that for "streaming" result
sets, we re-use the packet used to read rows, since only one row at a time is ever active.
* Made it possible to retrieve prepared statement parameter bindings (to be used in
StatementInterceptors, primarily).
* Row navigation now causes any streams/readers open on the result set to be closed, as
in some cases we're reading directly from a shared network packet and it will be
overwritten by the "next" row.
* Setting "rewriteBatchedStatements" to "true" now causes CallableStatements with
batched arguments to be re-written in the form "CALL (...); CALL (...); ..." to send the
batch in as few client-server round trips as possible.
* Driver now picks appropriate internal row representation (whole row in one buffer, or
individual byte[]s for each column value) depending on heuristics, including whether or
not the row has BLOB or TEXT types and the overall row-size. The threshold for row size
that will cause the driver to use a buffer rather than individual byte[]s is configured
by the configuration property "largeRowSizeThreshold", which has a default value of 2KB.
* When unpacking result set rows from result sets without TEXT or BLOB columns, the
driver now avoids one copy and reads from the network directly, resulting in an
approximate 3% performance increase for most workloads.
The following features are new, compared to the 5.0 series of Connector/J:
* JDBC-4.0 ease-of-development features including auto-registration with the
DriverManager via the service provider mechanism, standardized Connection validity checks
and categorized SQLExceptions based on recoverability/retry-ability and class of the
underlying error.
* JDBC-4.0 standardized unwrapping to interfaces that include vendor extensions
* Support for JDBC-4.0 XML processing via JAXP interfaces to DOM, SAX and StAX
* JDBC-4.0 support for setting per-connection client information (which can be viewed in
the comments section of a query via "SHOW PROCESSLIST" on a MySQL server, or can be
extended to support custom persistence of the information via a public interface)
* Support for JDBC-4.0 NCHAR, NVARCHAR and NCLOB types
* The driver will automatically adjust the server session variable "net_write_timeout"
when it determines its been asked for a "streaming" result, and resets it to the previous
value when the result set has been consumed. (The configuration property is named
"netTimeoutForStreamingResults", with a unit of seconds, the value '0' means the driver
will not try and adjust this value).
This release also includes the following cahnges that are also present in Connector/J
5.0.7 (not yet released):
* Setting the configuration parameter "useCursorFetch" to "true" for MySQL-5.0+ enables
the use of cursors that allow Connector/J to save memory by fetching result set rows in
chunks (where the chunk size is set by calling setFetchSize() on a Statement or
ResultSet) by using fully-materialized cursors on the server.
The driver will will now automatically set "useServerPrepStmts" to
"true" when "useCursorFetch" has been set to "true", since the feature
requires server-side prepared statements in order to function.
* Fixed BUG#28469 - PreparedStatement.getMetaData() for statements containing leading
one-line comments is not returned correctly.
As part of this fix, we also overhauled detection of DML for executeQuery() and
SELECTs for executeUpdate() in plain and prepared statements to be aware of the same
types of comments.
* Added configuration property "useNanosForElapsedTime" - for profiling/debugging
functionality that measures elapsed time, should the driver try to use nanoseconds
resolution if available (requires JDK >= 1.5)?
* Added configuration property "slowQueryThresholdNanos" - if "useNanosForElapsedTime"
is set to "true", and this property is set to a non-zero value the driver will use this
threshold (in nanosecond units) to determine if a query was slow, instead of using
millisecond units.
Note, that if "useNanosForElapsedTime" is set to "true", and this property is set to
"0" (or left default), then elapsed times will still be measured in nanoseconds (if
possible), but the slow query threshold will be converted from milliseconds to
nanoseconds, and thus have an upper bound of approximately 2000 millesconds (as that
threshold is represented as an integer, not a long).
* Added configuration properties to allow tuning of TCP/IP socket parameters:
"tcpNoDelay" - Should the driver set SO_TCP_NODELAY (disabling the
Nagle Algorithm, default "true")?
"tcpKeepAlive" - Should the driver set SO_KEEPALIVE (default "true")?
"tcpRcvBuf" - Should the driver set SO_RCV_BUF to the given value?
The default value of '0', means use the platform default
value for this property.
"tcpSndBuf" - Should the driver set SO_SND_BUF to the given value?
The default value of '0', means use the platform default
value for this property.
"tcpTrafficClass" - Should the driver set traffic class or
type-of-service fields? See the documentation
for java.net.Socket.setTrafficClass() for more
information.
* Give more information in EOFExceptions thrown out of MysqlIO (how many bytes the
driver expected to read, how many it actually read, say that communications with the
server were unexpectedly lost).
* Setting "useDynamicCharsetInfo" to "false" now causes driver to use static lookups for
collations as well (makes ResultSetMetadata.isCaseSensitive() much more efficient, which
leads to performance increase for ColdFusion, which calls this method for every column on
every table it sees, it appears).
* Driver detects when it is running in a ColdFusion MX server (tested with version 7),
and uses the configuration bundle "coldFusion", which sets useDynamicCharsetInfo to
"false" (see previous entry), and sets useLocalSessionState and autoReconnect to
"true".Enjoy!