Beginner's Problem / strange behavior [message #1016966] |
Fri, 08 March 2013 06:32  |
Eclipse User |
|
|
|
I am just switching from Hibernate to EclipseLink and am facing a strange problem.
Here's my persistence.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="removed because i am not allowed to post links"
xsi:schemaLocation="removed because i am not allowed to post links"
version="2.0" xmlns="removed because i am not allowed to post links">
<persistence-unit name="it-status" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/ampel" />
<property name="javax.persistence.jdbc.user" value="ampel" />
<property name="javax.persistence.jdbc.password" value="ampel" />
<property name="eclipselink.jdbc.connections.initial" value="1" />
<property name="eclipselink.jdbc.connections.min" value="16" />
<property name="eclipselink.jdbc.connections.max" value="16" />
<property name="eclipselink.logging.level" value="FINE" />
<property name="eclipselink.logging.thread" value="false" />
<property name="eclipselink.logging.session" value="false" />
<property name="eclipselink.logging.exceptions" value="false" />
<property name="eclipselink.logging.timestamp" value="false" />
</properties>
</persistence-unit>
</persistence>
However, it detects HSQLPlatform:
[EL Fine]: Detected database platform: org.eclipse.persistence.platform.database.HSQLPlatform
[EL Config]: Connection(6204974)--connecting(DatabaseLogin(
platform=>HSQLPlatform
user name=> "ampel"
connector=>JNDIConnector datasource name=>null
))
[EL Config]: Connection(6015989)--Connected: jdbc:hsqldb:file:data/hsqldb/hsqldb
User: SA
Database: HSQL Database Engine Version: 2.2.8
Driver: HSQL Database Engine Driver Version: 2.2.8
[EL Config]: Connection(11238785)--connecting(DatabaseLogin(
platform=>HSQLPlatform
user name=> "ampel"
connector=>JNDIConnector datasource name=>null
))
[EL Config]: Connection(15159299)--Connected: jdbc:hsqldb:file:data/hsqldb/hsqldb
User: SA
Database: HSQL Database Engine Version: 2.2.8
Driver: HSQL Database Engine Driver Version: 2.2.8
Even if i force the usage of the MySQL platform with , it still connects to a HSQL Database:
[EL Config]: Connection(22270740)--connecting(DatabaseLogin(
platform=>MySQLPlatform
user name=> "ampel"
connector=>JNDIConnector datasource name=>null
))
[EL Config]: Connection(25635634)--Connected: jdbc:hsqldb:file:data/hsqldb/hsqldb
User: SA
Database: HSQL Database Engine Version: 2.2.8
Driver: HSQL Database Engine Driver Version: 2.2.8
[EL Config]: Connection(19199473)--connecting(DatabaseLogin(
platform=>MySQLPlatform
user name=> "ampel"
connector=>JNDIConnector datasource name=>null
))
[EL Config]: Connection(3869646)--Connected: jdbc:hsqldb:file:data/hsqldb/hsqldb
User: SA
Database: HSQL Database Engine Version: 2.2.8
Driver: HSQL Database Engine Driver Version: 2.2.8
It also doesn't seem to care or even try to make a MySQL connection, so it doesn't matter if the mysql-connector jar is in WEB-INF/lib or not.
What's strange about this is that it correctly reads the user name from the persistence.xml, which means that the javax.persistence.jdbc.* properties are being read.
However, I get no Error/Warning whatsoever. It just doesn't even try to use MySQL.
I'm using this in a Vaadin application on TomEE 1.5.1 and I have been stuck here for three straight days now.
Does anyone have an idea what I am doing wrong?
|
|
|
|
|
|
|
|
Re: Beginner's Problem / strange behavior [message #1039892 is a reply to message #1039760] |
Fri, 12 April 2013 15:15  |
Eclipse User |
|
|
|
If you set the logging level to FINEST, it will log what the property value is when it is set on the Session, which occurs in the deployment phase right before login, just after it reads and logs the javax.persistence.transactionType property. If it is not the value it should be, then something is injecting a property somehow or the wrong persistence.xml is being picked up - logging should also show where the persistence.xml being read in is located.
|
|
|
Powered by
FUDForum. Page generated in 0.04983 seconds