Cannot use other then default datasource for persistence.xml
tstaniszewski Sep 21, 2005 9:12 AMI've built a .par archive with persistence.xml and 25 entity beans. Connection parameters points to MS SQL server, however this is ignored by hibernate - default HSQL datasource is used instead. It's strange because changes in "hibernate.dialog" values are shown properly, but connection is skipped... The same happens when using <jta-data-properties>. What is wrong??? Am I doing something really stupid?
I'm using ejb3 RC2 with jboss 4.03 RC2
persistance.xml:
<?xml version="1.0" encoding="UTF-8"?> <entity-manager> <name>sqlbzi</name> <class>pzu.bzi.db.bzi.Aplikacje</class> .... more classes <properties> <property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://hhhhh:1433/iiii"/> <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/> <property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/> <property name="hibernate.connection.password" value="xxxx"/> <property name="hibernate.connection.username" value="yyyy"/> </properties> </entity-manager>
log looks like this:
13:01:27,912 INFO [JaccHelper] Initialising JACC Context for deployment: sqlbzi.par 13:01:28,144 INFO [Ejb3Deployment] Found persistence.xml file in EJB3 jar 13:01:28,244 INFO [Environment] Hibernate 3.1 beta 3 13:01:28,254 INFO [Environment] hibernate.properties not found 13:01:28,259 INFO [Environment] using CGLIB reflection optimizer 13:01:28,260 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling 13:01:28,442 INFO [Ejb3Configuration] found EJB3 Entity bean: pzu.bzi.db.bzi.Aplikacje [ .... more entities found ] 13:01:30,225 INFO [Configuration] processing extends queue 13:01:30,233 INFO [Configuration] processing collection mappings 13:01:30,238 INFO [CollectionBinder] Mapping collection: pzu.bzi.db.bzi.Typykostek.mddbs -> mddb [ .... more mappings ] 13:01:30,255 INFO [Configuration] processing association property references 13:01:30,255 INFO [Configuration] processing foreign key constraints 13:01:30,920 INFO [Configuration] processing extends queue 13:01:30,920 INFO [Configuration] processing collection mappings 13:01:30,920 INFO [Configuration] processing association property references 13:01:30,920 INFO [Configuration] processing foreign key constraints 13:01:30,942 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.InjectedDataSourceConnectionProvider 13:01:30,952 INFO [InjectedDataSourceConnectionProvider] Using provided datasource 13:01:30,959 INFO [SettingsFactory] RDBMS: HSQL Database Engine, version: 1.8.0 13:01:30,959 INFO [SettingsFactory] JDBC driver: HSQL Database Engine Driver, version: 1.8.0 13:01:31,128 INFO [Dialect] Using dialect: org.hibernate.dialect.SQLServerDialect [... the rest is wrong, I want to use MS SQL, not build in HSQL ]
Tomek Staniszewski