Dataloss when shutting down seam application on Weblogic 10.3.3
fquadt Apr 14, 2011 5:33 AMHello,
we are developing a Seam application (JavaBeans, WAR) on JBoss AS 4.2.3. In this environment everything is running fine. But the targeted production environment is a Weblogic 10.3.3 server. Here we are experiencing data loss when shutting down the Weblogic server using the shutdown script stopWeblogic.sh.
During startup of the application we get the following warning:
WARNING: JTASessionContext being used with JDBCTransactionFactory; auto-flush will not operate correctly with getCurrentSession()>
At the end of the shutdown we get the following warning:
<Warning> <Common> <BEA-000632> <Resource Pool "myDatasource" shutting down, ignoring 1 resources still in use by applications..>
myDatasource is an Oracle Datasource and is behaving fine, but we have a second datasource (local H2 database) which seems not being properly closed during server shutdown. After the application server has been restarted some data from the H2 datasource are missing.
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?> <!-- Persistence deployment descriptor for dev profile --> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="atarrabi" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>atarrabiDatasource</jta-data-source> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> <!-- * validate: validate the schema, makes no changes to the database. * update: update the schema. * create: creates the schema, destroying previous data. * create-drop: drop the schema at the end of the session. --> <!-- <property name="hibernate.hbm2ddl.auto" value="create"/> --> <!-- <property name="hibernate.hbm2ddl.auto" value="create-drop"/> --> <property name="hibernate.hbm2ddl.auto" value="update"/> <!-- <property name="hibernate.hbm2ddl.auto" value="validate"/>--> <property name="hibernate.show_sql" value="false"/> <property name="hibernate.format_sql" value="false"/> <property name="hibernate.use_sql_comments" value="false"/> <!-- weblogic specific --> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/> <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/> </properties> </persistence-unit> </persistence>
Ideas are really appreciated!
Thanks,
Florian