Weblogic 10.3 with mysql
Hi, i try to deploy a ejb 3.0 -toplink projekt built by jdev 11g released1 on weblogic 10.3.
I use for the datasource a mysql 5.0.45 database.
I use the driver class mysql-connector-java-5.1.6-bin.jar
In the ..\wlserver_10.3\server\ext\jdbc\mysql directory I added the driver class too.
By starting the SessionBean this exception is reased:
09.10.2008 20:58:43 com.sun.faces.spi.InjectionProviderFactory getProviderInstance
SCHWERWIEGEND: JSF1030: The specified InjectionProvider implementation 'com.bea.faces.WeblogicInjectionProvider' cannot be loaded.
Can somebody help me, or what is need to deploy it to jboss?
OK, now I know that this error doesn't matter.
I tryed the ejb-s with a oracle 10g xe database, it works fine. But if i want to use the mysql database nothing works any more.
This exception is always raised:
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:387)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
Truncated. see log file for complete stacktrace
Exception [EclipseLink-28010] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: PersistenceUnitInfo Model has transactionType JTA, but doesnt have jtaDataSource.
at org.eclipse.persistence.exceptions.EntityManagerSetupException.jtaPersistenceUnitInfoMissingJtaDataSource(EntityManagerSetupException.java:154)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:790)
at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:195)
at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:330)
at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:123)
Truncated. see log file for complete stacktrace
This is the persitence unit:
<persistence-unit name="Model-1" transaction-type="RESOURCE_LOCAL">
<provider>
org.eclipse.persistence.jpa.PersistenceProvider
</provider>
<class>
model.Uebertabelle
</class>
<class>
model.Tabelle1
</class>
<properties>
<property name="eclipselink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="eclipselink.jdbc.url" value="jdbc:mysql://localhost:3306/pipeulator"/>
<property name="eclipselink.jdbc.user" value="root"/>
<property name="eclipselink.jdbc.password" value=""/>
<property name="eclipselink.logging.level" value="FINER"/>
<property name="eclipselink.target-server" value="WebLogic_10"/>
<property name="eclipselink.jdbc.platform" value="org.eclipse.persistence.platform.database.oracle.OraclePlatform"/>
</properties>
</persistence-unit>
There are any ideas?
Similar Messages
-
How to use CMP in Weblogic 9.2 with MySQL?
Hello all...
So I've been tasked wiith moving an Oracle/Weblogic installation to a MySQL/Weblogic platform. Things are moving along well, except that in my CMP (Container-Managed Persistence) descriptors, the database-type is set to "Oracle" and there are references to columns of type "OracleBlob" and "OracleClob".
I changed database-type to "MySQL" and those columns to "Blob" and "Clob", but it doesn't work -- Weblogic reports that MySQL doesn't support Blobs and Clobs (which is untrue, but perhaps Weblogic 9.2 doesn't know how to deal with MySQL Blobs and Clobs).
Has anyone encountered this before? Is there a workaround? I've Google'd it and looked here, and it doesn't seem like many people use this combination of MySQL and Weblogic, so there's not much discussed on this topic.
Any help would be much appreciated!
- Tim BessieFirst you need to make sure that you are using supported configuration. CMP (WebLogic feature) is supported with MySql4 with Connect/J
http://edocs.bea.com/platform/suppconfigs/configs92/92_over/supported_db.html#1177621
Thanks,
Jayesh
Yagna Sys -
Application server 9.0 with mysql
Hello!
I'm using glassfish with application server 9.0 and i want to connect with mysql.
My settings are:
datasource classname: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
resource type: javax.sql.connectionpoolDataSource
ARE OK?
I use mysql connector 3.1.13, 5.0.2 or 3.1.13? which is correct?
ThanksHi,
Please take a look at the following blog which talks about using mysql with Glassfish:
http://weblogs.java.net/blog/amyroh/archive/2006/02/roller_21_on_gl_1.html
In this example the driver that she uses is sql-connector-java-3.1.12-bin.jar
Also, she uses the following:
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"
which is slightly different to the one that you are using... maybe you should try this....
Also, please take a look at the three furum posts already raised on similar issues to this:
http://forum.sun.com/jive/thread.jspa?threadID=102999
Hope this helps -
OBIEE 11G with MySql Issue Hierarchy is not working..
Hi,
i am using the OBIEE 11G with MySQL DB. i have sucessfully created the RPD. i created the Hierarchy in the RPD. this is the scerario i have created.
i have only one data column created_at. by using this column i create 3 more logical logical columns, which are Year,Month Name,Week and created Hierarchy by taking the these columns only.
when i am viewing the result by taking the hierarchy it throwing the error systax error"ou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version".
but we selecting the year column it successfully nagvigating to the month level data but when selecting the Hierarchy directly it is unable to navigate from year to month.
please provide me the solution for this as soon as possbile i have an urgent requirement on this.
Thanks,
Yogi.Hi,
Thanks for you post..
My Requriement is that we no need to create new columns we need to necessary columns in BMM layer only and we need to use them in Hierarchy.
Thanks,
Yogi. -
Can' t connect Java with MySQL
My goal is to connect Java with MySQL. I found many solutions on Internet, but I always get the same mistake:
SQLException: No suitable driver
SQLState: 08001
VendorError: 0MySQL works fine alone or with php.Only thing left me to think is that the installed versions are not compatible for this mysql-connector-java-5.0.4
I don't believe that could be a reason.
Installed versions are:
Apache Tomcat 5.5.20 Server
Apache HTTP Server 2.2.4
PHP 5.2.0
MySQL 5.2
jre 1.5.0_11
jdk1.5.0_11
Apache Tomacat JK2 connector Version: 1.2.20 File Name: mod_jk-apache-2.2.3.so
mysql-connector-java-5.0.4
I also set connector in class path: C:\mysql-connector-java-5.0.4;C:\mysql-connector-java-5.0.4\mysql-connector-java-5.0.4-bin.jar;C:\mysql-connector-java-5.0.4\src\com\mysql\jdbc
For installation I used manulas from:
http://apacheguide.org/jsp.php
http://doc.51windows.net/mysql/?url=/MySQL/ch23s03.html
Here is also a test code in java:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Connect
public static void main (String[] args)
Connection conn = null;
try {
conn =
DriverManager.getConnection("jdbc:mysql://localhost/first_test" +
"user=monty&password=greatsqldb");
// Do something with the Connection
} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
}i'm desperate, please help or tell me someone who'll know the answer.
Thank You in advancehey buddy .. it seems yr code is wrong .. in getconnection () method u should also specify the port ,which u r not doing ...
the default port for MySQL is 3306 ... see below i am giving you a sample code ... its working fine .. and dont forget to put the MySQL driver jar path in to classpath and also copy the jar into common/lib folder of your tomcat ....
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class MySQLConnectionTest {
public static void main(String[] args) {
new MySQLConnectionTest().connTest();
public void connTest() {
String tableName = "portfolio"; //change as per setting
String hostName = "10.81.9.39"; // please change for the target database ip or hostname
String dbPort = "3306"; //change if not using the default
String dbName = "tradingsystem"; //change as per the given DB name
String username = "root"; //change as per setting
String password = "password"; //change as per setting
System.out.println("before try");
Double data=0.0;
Double data1=0.0;
try {
Class.forName("org.gjt.mm.mysql.Driver");
System.out.println("before driver manager");
Connection conn = DriverManager.getConnection("jdbc:mysql://"+hostName+":"+dbPort+"/"+dbName, username, password);
String query1 = "select * from "+tableName+" where User_id='trader1' and Stock_Type='Equity'";
System.out.println("quesry1="+query1);
Statement stmt = conn.createStatement();
ResultSet rs1 = stmt.executeQuery(query1);
while(rs1.next())
System.out.println("hiiiiii for rs1");
System.out.println(rs1);
Quantity=(Integer)rs1.getObject(5);
MarketPrice=(Double) rs1.getObject(8);
data=Quantity*MarketPrice;
data1+=data;
System.out.println("data1="+data1);
i=0;
rs1.close();
stmt.close();
conn.close();
} catch (ClassNotFoundException e) {
e.printStackTrace(System.err);
} catch (SQLException e) {
e.printStackTrace(System.err);
i hope it will work for u...
cheers, -
JDeveloper 10.1.2 with MySQL and PostgreSQL
I'm testing JDeveloper 10.1.2 business components with mysql or postgresql because my company needs to connect also to these non-oracle DBs. ADF suits our developement needs, in speed and functionalities; anyway to make it our main developement system we need it to be compatible.
I made three tests and they were all disappointing.
At first, I installed MySQL 4.0 on my windows machine. I used the stable Connector/J 3.1
and then MySQL Connector/J 3.0, but in both cases JDeveloper had a strange behaviour: I can make the connection, I can navigate correctly through all tables in the connection-navigator, I see all the column names etc... Anyway, as I try to build a "new Entity Object" from a table, there are no available table properties, like if the table had no columns.
In this forum I only found documentation about rowid problems with mysql, but nothing about Entity Object wizard issues.
Then I switched to PostgreSQL. I installed it locally, so I had to choose the 8.01 since I'm on a windows machine. JDBC driver: postgresql-8.0-310 jdbc3
The developement test phase went ok, it is possible to use this DB just as if it was a Oracle, all the business components wizards works perfectly.
The problem is at runtime, unfortunately. I built a simple datapage on the struts-config diagram and I dragged on it a "read-only table" from the data control palette.
As I run the application, the embedded OC4J immediately returns this error:
oracle.jbo.JboException: JBO-29000: JBO-29000: JBO-29000: JBO-26061: Errore durante lapertura della connessione JDBC.
at oracle.jbo.JboException.<init>(JboException.java:343)
(in english: Error during JDBC connection)
There are no other available JDBC drivers for JVM 1.4x so I see no solution...
I also tried to connect to an older PostgresSQL with its (older) JDBC but I get same the result.
Anyone can help? Is it a JDev 10.1.2 issue?Hi Paolo.
I'm also doing such tests.
I did not ran into these problems because I created the busisness componentes using an Oracle connection first.
After that, I switched the datatype of the table columns in the entity object to meet the SQL92 criteria ( like changing NUMBER(n) to INTEGER ).
And then, I switched the connection to the postgreSQL or MySQL. This worked fine for me.
But, the other big problem you will face is related to updating records using postgreSQL connection.
Please see my post "Problem updating records using BC4J with foreign data sources" Problem updating records using BC4J with foreign data sources
It would by fine if we help each other to solve this problems.
Thanks
Denis -
i am using JSP in Linux Platform. when i connected to mysql with mysql driver for odbc by using the following code,
import java.sql.*;
public class TestMysql
public static void main(String args[]) {
try {
Connection con;
String connStr = "jdbc:mysql://localhost/test?user=root&password=mysql";
Class.forName( "com.mysql.jdbc.Driver" ).newInstance();
System.out.println("OK");
con = DriverManager.getConnection( connStr );
System.out.println("Again OK");
catch( Exception x )
x.printStackTrace();
i got the following exception
OK
java.sql.SQLException: Error during query: Unexpected Exception: java.io.CharConversionException message given: null
Nested Stack Trace:
** BEGIN NESTED EXCEPTION **
java.io.CharConversionException
STACKTRACE:
java.io.CharConversionException
at gnu.gcj.convert.Input_iconv.read(char[], int, int) (/usr/lib/libgcj.so.5.0.0)
at java.lang.String.init(byte[], int, int, java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at java.lang.String.String(byte[], int, int, java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at com.mysql.jdbc.SingleByteCharsetConverter.SingleByteCharsetConverter(java.lang.String) (Unknown Source)
at com.mysql.jdbc.SingleByteCharsetConverter.initCharset(java.lang.String) (Unknown Source)
at com.mysql.jdbc.SingleByteCharsetConverter.getInstance(java.lang.String, com.mysql.jdbc.Connection) (Unknown Source)
at com.mysql.jdbc.Connection.getCharsetConverter(java.lang.String) (Unknown Source)
at com.mysql.jdbc.StringUtils.getBytes(java.lang.String, java.lang.String, java.lang.String, boolean, com.mysql.jdbc.Connection) (Unknown Source)
at com.mysql.jdbc.Buffer.writeStringNoNull(java.lang.String, java.lang.String, java.lang.String, boolean, com.mysql.jdbc.Connection) (Unknown Source)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(com.mysql.jdbc.Statement, java.lang.String, java.lang.String, com.mysql.jdbc.Buffer, int, com.mysql.jdbc.Connection, int, int, boolean, java.lang.String, boolean) (Unknown Source)
at com.mysql.jdbc.Connection.execSQL(com.mysql.jdbc.Statement, java.lang.String, int, com.mysql.jdbc.Buffer, int, int, boolean, java.lang.String, boolean, boolean) (Unknown Source)
at com.mysql.jdbc.Connection.configureClientCharacterSet() (Unknown Source)
at com.mysql.jdbc.Connection.initializePropsFromServer() (Unknown Source)
at com.mysql.jdbc.Connection.createNewIO(boolean) (Unknown Source)
at com.mysql.jdbc.Connection.Connection(java.lang.String, int, java.util.Properties, java.lang.String, java.lang.String) (Unknown Source)
at com.mysql.jdbc.NonRegisteringDriver.connect(java.lang.String, java.util.Properties) (Unknown Source)
at java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties) (/usr/lib/libgcj.so.5.0.0)
at java.sql.DriverManager.getConnection(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at TestMysql.main(java.lang.String[]) (Unknown Source)
** END NESTED EXCEPTION **
at com.mysql.jdbc.Connection.execSQL(com.mysql.jdbc.Statement, java.lang.String, int, com.mysql.jdbc.Buffer, int, int, boolean, java.lang.String, boolean, boolean) (Unknown Source)
at com.mysql.jdbc.Connection.configureClientCharacterSet() (Unknown Source)
at com.mysql.jdbc.Connection.initializePropsFromServer() (Unknown Source)
at com.mysql.jdbc.Connection.createNewIO(boolean) (Unknown Source)
at com.mysql.jdbc.Connection.Connection(java.lang.String, int, java.util.Properties, java.lang.String, java.lang.String) (Unknown Source)
at com.mysql.jdbc.NonRegisteringDriver.connect(java.lang.String, java.util.Properties) (Unknown Source)
at java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties) (/usr/lib/libgcj.so.5.0.0)
at java.sql.DriverManager.getConnection(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at TestMysql.main(java.lang.String[]) (Unknown Source)
i have the database, hello.
The same code works well in Windows, But in Linux, the above exception.
By using the username root and password mysql , i can connect to mysql directly from the mysql prompt.
Pls help me..
I have already put the query 'access denied problem in Mysql' some day before. from the reply, i made some changes in user table(ie. set the password for [email protected].).After this change, this new Exception came..
The structure of my mysql.user table is
# host user password
1 localhost root 68d4f47c49a579c9
2 localhost.localdomain root 68d4f47c49a579c9
3 localhost.localdomain
4 localhost
Pls help me.
Edited by: SUMESHBABU_R on Sep 30, 2007 11:36 PMWell, at least the trace tells me that this issue is to be tracked back to the core of the MySQL JDBC driver and the Linux's implementation of JVM. It might be worth the effort to post this issue at their website/forum/issuetracker. It might also be worth the effort to tryout the newer MySQL JDBC driver 5.1, as it is written specific for JDK 6.0 (while MySQL JDBC driver 5.0 is targeted at JDK 5.0).
-
Setting up testing server with MySQL
I am just migrating to the MacBook from an older iMac G5. I was running PHP with MySQL 4.1.15. I just downloaded the PHP 5.2.2 and need to know which version of MySQL will run with it on my MacBook. Any help, please, especially if you are using Dreamweaver and have migrated to CS3. Thanks, Jay
Hi
I am successfully running MySQL 5.0.37 with PHP 5.2.1. (I don't use Dreamweaver or CS3 though.)
Matt -
How to use Ago function in BIEE with mysql database
Hi experts,
Ago function works well in Oracle database,but when I tried a mysql database,it didn't show results as expected. Anyone knows how to use Ago with mysql as data source?Hi Gurus, need help
-
Clob mapping not working with mysql
Hi,
I have an application that i'm running with MySQL and Oracle at the same
time. At some point, i need to use a 'clob' mapping. When i do this, it
just works fine with oracle but it fails with mysql. i have the exception:
Field "com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description"
is mapped as a clob, but should be represented as a different mapping.
If the field is a string and you would like to force it to map as a
clob, add an extension to its field metadata with a key of "jdbc-size"
and a value of
-1.[com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description]
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:132)
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:118)
at
kodo.jdbc.meta.ClobFieldMapping.fromMappingInfo(ClobFieldMapping.java:46)
if i use a value mapping, it works with MySQL but fails with Oracle (I
have sql error because a clob is used in a distinct select).
In the manual, it is written "Note that some databases can support
string of unlimited length without using a CLOB; when this is the case
the mapping tool will install a value mapping in favor of
this mapping.". So apparently, this is not the case with MySQLDictionary.
To solve my problem and have my code working with both databases, i had
to extend the MySQLDictionary and overwrite the replaceFieldMapping
method in order to replace the clob mapping by a value mapping at
runtime but i don't feel confident to do this kind of modifications by
mysel and would expect this behaviour to be solved quite soon.
Thanks for your help since this problem is urgent for us,
Laurent CzinczenheimLaurent-
The best solution would probably be to just have separate mappings for
the MySQL and Oracle databases. The easiest way to accomplish this would
be to have a separate setting for each of the databases. E.g.:
kodo.jdbc.meta.MappingFactory: file(SingleFile=true, FileName=oracle.mapping)
kodo.jdbc.meta.MappingFactory: file(SingleFile=true, FileName=mysql.mapping)
That way, you can use a clob mapping for Oracle, and a normal value
mapping for MySQL (since MySQL doesn't need to use the CLOB mapping, and
it isn't very efficient).
For more details on this, see:
http://docs.solarmetric.com/manual.html#ref_guide_mapping_factory
Another solution is to just stick with your custom extension of the
MySQLDictionary, which is a perfectly valid way of having special CLOB
handling in MySQL. Note, though, that CLOB handling is less efficient
than VARCHAR handling, so it should be a mapping of last resort, and
there isn't any need to use it in MySQL.
In article <[email protected]>, czinczenheim wrote:
Hi,
I have an application that i'm running with MySQL and Oracle at the same
time. At some point, i need to use a 'clob' mapping. When i do this, it
just works fine with oracle but it fails with mysql. i have the exception:
Field "com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description"
is mapped as a clob, but should be represented as a different mapping.
If the field is a string and you would like to force it to map as a
clob, add an extension to its field metadata with a key of "jdbc-size"
and a value of
-1.[com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description]
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:132)
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:118)
at
kodo.jdbc.meta.ClobFieldMapping.fromMappingInfo(ClobFieldMapping.java:46)
if i use a value mapping, it works with MySQL but fails with Oracle (I
have sql error because a clob is used in a distinct select).
In the manual, it is written "Note that some databases can support
string of unlimited length without using a CLOB; when this is the case
the mapping tool will install a value mapping in favor of
this mapping.". So apparently, this is not the case with MySQLDictionary.
To solve my problem and have my code working with both databases, i had
to extend the MySQLDictionary and overwrite the replaceFieldMapping
method in order to replace the clob mapping by a value mapping at
runtime but i don't feel confident to do this kind of modifications by
mysel and would expect this behaviour to be solved quite soon.
Thanks for your help since this problem is urgent for us,
Laurent Czinczenheim
Marc Prud'hommeaux
SolarMetric Inc. -
Powerdns with MySQL doesn't work
I recently switched from ubuntu to Arch and I love it. However I have problems with PowerDNS running with MySQL database. When I set pdns.conf to
launch=gmysql
gmysql-host=127.0.0.1
gmysql-user=user
gmysql-password=pass
gmysql-dbname=database_name
and restart pdns i get this error:
Oct 22 22:43:34 Archlinux pdns[3337]: Caught an exception instantiating a backend, cleaning up
Oct 22 22:43:34 Archlinux pdns[3337]: gmysql Connection failed: Unable to connect to database: Lost connection to MySQL server at 'reading initial communication packet', system error: 0
Socket connection doesn't work either.
If someone could help me out of this I would be very happy.
Best regards!
JernejIt works! Thank you! Thank you! Thank you!
I wasted so many hours combating this...
I owe you a beer byte! Thx again! -
About using hibernate with mysql
hi all,
i have used hibernate with hsqldb(database given by default) and it works fine.but when i tried to use it with mysql then i have encountered a problem
xception
org.hibernate.TransactionException: Transaction not successfully started
org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
events.EventManagerServlet.doGet(EventManagerServlet.java:63)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
though i have put jar file of mysql in lib directory and changed the driver name in hibernate.cfg.xml.
can any one place some example illustrating the steps involving.thanxHi smogura,
Thanks for the message. Ok I did as you told. I believe I went to the right place:
Resource->JDBC Connection pools. However I wasn't sure how exactly to go about setting connection pools,
so I went to the web and did a search and I managed to get hold of this
website:http://www.albeesonline.com/blog/2008/08/06/creating-and-configuring-a-mysql-datasource-in-
glassfish-application-server/
I followed from steps 4 onwards. However at step 14, I did not get a sucesfull ping. The values I used are as follows:
General:
Name: MySQL
Datasource Classname: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
Resource Type: javax.sql.ConnectionPoolDataSource
Advanced Properties:
databaseName: ebooking
ServerName: GlassFish
URL jdbc:mysql://localhost:3306/ebooking
password *****
user: 1234
I am not sure what is wrong, by the way, I am using Glassfish V3 that comes bundled with netbeans. Any idea what's wrong or missing? Thanks
regards -
Reconnect policy with MySQL failing because of autoCommit error
This related to this issue, but I didn't see any responses to it: Reconnecting a dead connection from a UnitOfWork commit - Autocommit error
I'm testing with MySQL 4.1 and I have a reconnect policy that does the following (I believe this is a pretty standard approach):
session.setExceptionHandler( new ExceptionHandler() {
public Object handleException(RuntimeException exception) {
if (exception instanceof DatabaseException) {
dbex.getAccessor().reestablishConnection(dbex.getSession());
However, when it reestablishes the connection (and I have traced this and can verify that this code is executing and a reconnect is performed), I get the following error for any updates:
Internal Exception: java.sql.SQLException: Can't call rollback when autocommit=trueError Code: 0
at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:277)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicRollbackTransaction(DatabaseAccessor.java:1090)
at oracle.toplink.internal.databaseaccess.DatasourceAccessor.rollbackTransaction(DatasourceAccessor.java:486)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.rollbackTransaction(DatabaseAccessor.java:1075)
at oracle.toplink.publicinterface.Session.basicRollbackTransaction(Session.java:377)
I only have this problem with the MySQL JDBC drivers. I can continue to read normally, but I can't perform any transactions.
This isn't so much of a question about MySQL specifically, but rather a question about how reestablishConnection() connects to the database differently from my initial login using DatabaseLogin. Obviously, I don't have this error connecting normally. I only get it after a reconnect is applied.
Specific questions are: Is there another handler I can add to ensure JDBC Connections returned by ServerSession are always setAutoCommit(false)? Am I reestablishing the JDBC connections incorrectly?
NateNate,
This does appear to be MySQL JDBC specific but is most likely related to a general issue.
When the connection drops and you receive the notification through the exception handler I would typically recommend looking at the session in us (isUnitOfWork) or the query type (isWriteObjectQuery) to see if the operation that failed was involved in a transaction (UnitOfWork commit).
In these transaction cases you need to do more then just re-connect and retry. You need to ensure after reconnection that an application exception is raised so the UnitOfWork operation(s) can be retried completely. I would simply add to this case to ensure that the JDBC connection is put back in a state where it can be managed properly.
There is no special operation or any case I know of where any special auto-commit needs to be set on a connection after it has dropped and before it is re-connected.
Doug -
Install weblogic server 6 with sp1 failure in W2K
When I install weblogic server 6 with sp1 in W2K,
InstallAnyWhere display, when InstallAnyWhere process 100%,
there is nothing in my display about the Install.
there is weblogic600sp1_ and javaw in Windows Task manager->process.
I have install JDK1.3If I remember correctly, you should make sure that the JDK is not in your
path.
Michael Girdley
BEA Systems
Learning WebLogic? http://learnweblogic.com
"yshyang" <[email protected]> wrote in message
news:[email protected]..
When I install weblogic server 6 with sp1 in W2K,
InstallAnyWhere display, when InstallAnyWhere process 100%,
there is nothing in my display about the Install.
there is weblogic600sp1_ and javaw in Windows Task manager->process.
I have install JDK1.3 -
ExecuteQuery() error with MySQL
I have already followed all the steps recommended by OTN to create a connection with MySQL (most up-to-date files) in JDeveloper 10g. It works fine except when I try to find a view and execute a query using an Application Module in a jsp:
ApplicationModule appMod = appMod.getGenericAppMod();
ViewObject voTabEmployee = appMod.findViewObject("TabEmployee");
voTabEmployee.executeQuery();
It works ok when connected to Oracle DB but it raises the following exception when I move Business Components to a MySQL connection, exactly as recommended:
java.lang.ClassCastException: com.mysql.jdbc.ServerPreparedStatement
Any help would be highly appreciated.
MarcioHi Marcio
The ApplicationModule that you create in your source (utilApp.java) is created using the default configuration that uses the OracleSQLBuilder as the default SQLBuilder (configured to work with Oracle Databases). Thus, when you use MySQL or any other database (and I confirmed this using SQLServer), a ClassCastException is thrown.
Instead of using the following lines:
Context ic = new InitialContext(env);
String theAMDefName = "mysysjcom.MySysJComModule";
ApplicationModuleHome home = (ApplicationModuleHome) ic.lookup(theAMDefName);
ApplicationModule appMod = home.create();
appMod.getTransaction().connectToDataSource(null, "jdbc/MYSYSJCOMCoreDS", false);
can you use the following lines:?
Context ic = new InitialContext(env);
String theAMDefName = "mysysjcom.MySysJComModule";
ApplicationModule appMod = Configuration.createRootApplicationModule(theAMDefName, <config_name>);
ic.lookup(theAMDefName);
I got your sample working with the above change
This will ensure that you are using the same configuration that has the SQLBuilder correctly set to your Database type
Thanks
Prasanth
Maybe you are looking for
-
Testing SSL Connections, differences between ABAP and JAVA stacks
Hello, I am trying to test an outbound SSL connection to a partner. I already have multiple outbound connections to many partners, but this new one is causing an issue. Our firewalls between the two sites are opened as required, I verified tha
-
Connecting a Local Java Program with a Mysql Database Hosted on the Interne
I need help. I want to connect a java program running on local user computers to read and write to a mysql database hosted in my domain by an internet service provider. What code do i use? How do i connect?
-
How to Enter Event Parameters in FM SAP_WAPI_CREATE_EVENT_EXTENDED
Hi, I am trying to trigger theEvent 'START_RM_WEBREQ' for an ABAP Class 'CL_HREIC_RM_WORKFLOW' using the above mentioned FM. Usually this can be done using SWUE, however I am asked to do it create a custom program that would do the functionality for
-
URGENT HELP-Connecting 2 Switches
Hi All, I need to connect 2 switches (2960 & 2960S) with only one single link in our LAN network. This is to get extra number of ports. Requesting your help with the followings: Please confirm if straight throug cable will work to connect between the
-
Mapping logic and alert configuration
My scenario is Asynchronous. No BPM in this scenario Sender & receiver data type is like this HEADER HedgId ItemNo ITEMDATA Month Vol Hsfo Conditions are: Sender side 1). If above fields are come to blank into Xi (means no value in the fi