Hi all, as smart ( and lazy ) as I am I tried to use schemaexport
through my pico container in JBoss.
So, I created it with the very same hibernate configuration properties as my SessionFactory:
<code>
hibernate.connection.driver_class=org.gjt.mm.mysql.Driver
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup
hibernate.connection.datasource=java:status_ds
</code>
But then it said me:
<code>
10:53:43,550 ERROR [STDERR] java.sql.SQLException: You cannot commit with autocommit set!
10:53:43,553 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:368)
10:53:43,555 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:447)
10:53:43,556 ERROR [STDERR] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:111)
10:53:43,557 ERROR [STDERR] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.drop(SchemaExport.java:88)
10:53:43,558 ERROR [STDERR] at com.infodesire.status.project.action.DropDatabaseAction.doExecute(DropDatabaseAction.java:42)
10:53:43,559 ERROR [STDERR] at webwork.action.ActionSupport.execute(ActionSupport.java:149)
10:53:43,562 ERROR [STDERR] at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:131)
10:53:43,563 ERROR [STDERR] at webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:165)
10:53:43,565 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
10:53:43,566 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
10:53:43,567 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
10:53:43,568 ERROR [STDERR] at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:123)
10:53:43,569 ERROR [STDERR] at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:66)
</code>
That's funny, but exact the same approach worked in unit tests...
( here code from my action for curious )
<code>
public String doExecute() throws Exception {
_schemaExport.drop(true, true);
_schemaExport.create(true, true);
return SUCCESS;
}
</code>
Do I miss something important?
_________________ Got new hibernate xdoclet plugin? http://www.sourceforge.net/projects/xdoclet-plugins/
... Momentan auf der Suche nach neuen Projekt ode Festanstellung....
|