![]()
|
||||
JOnAS EJB server, Enhydra, MySQL, JTA, Java Transaction API, JDBCThis article describes how to use JOnAS EJB server (Enhydra) with MySQL. JOnAS is the implementation of EJB specification Version 1.1, which supports JTA (Java Transaction API). And JOnAS requires JDBC 2.0 compatible driver, including the transaction. But MySQL supports the transaction (BEGIN, COMMIT and ROLLBACK) only in some situation. In the environment where the transaction is not supported, some configuration may be required to work with JOnAS EJB (Enterprise Java Beans) server. But don't worry. MM.MySQL JDBC driver is prepared for JOnAS. |
||||
What is JOnAS?
EJB is the core architecture of J2EE. To build up the enterprise-oriented, network-oriented and system-independent Java components, EJB is essential architecture for the serious developer in the world. Since EJB 1.1 specification was released, we have desired some sophisticated EJB compliant server.
JOnAS is one of the most powerful EJB server in the world. JOnAS provides us everything we need:
Requirement:MySQL is the world fastest SQL database, which is available for most platform at: JOnAS supports JTA (Java Transaction API) and requires JDBC 2.0 compatible driver. JDBC 2.0 driver for MySQL is available at: Please download MM.MySQL driver 2.04 or later.
Transaction support in MySQL:MySQL Version 3.23.15 or later supports:
These syntaxes are effective only for transaction safe tables (BDB, INNOBASE or GEMINI). As for other types of tables, changes will be stored at once independent from the status of AUTOCOMMIT, i.e. the syntaxes above are not effective. For details, please read the documentation of MySQL.
Behavior of MM MySQL driver:0. When the connection is established
If the MySQL server is Version 3.23.15 or later, transactionsSupported is set to true.
1. setAutoCommit(false)In case the Version 3.23.15 or later, setAutoCommit(false) executes:
Or, if relaxAutoCommit property is set to true, this method does nothing. Note that the relaxAutoCommit property is checked only if the version is older than 3.23.15. 2. commit()Assuming that setAutoCommit(false) is already invoked without the exception.If the version is 3.23.15 or later, commit() executes:
3. rollback()
Assuming that setAutoCommit(false) is already invoked without the exception.
JOnAS and MySQL connected by MM.MySQL:
Because JOnAS EJB server requires the JDBC 2.0 compatible driver, setAutoCommit(false) need to be invoked without exception.
|
|
|||
|
Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries. |
||||
|
ALL CONTENTS COPYRIGHT 1997-2007, OOP-Research Corporation. All rights reserved. |
||||