-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Schemaexport inside JBoss app?
PostPosted: Fri Feb 20, 2004 6:04 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
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....


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2004 10:26 am 
Beginner
Beginner

Joined: Mon Mar 22, 2004 10:01 am
Posts: 22
i need the same thing...

the bad news is that it needs a patch that adds functionality to the jca managedsessionfactory to get the configuration. plus possibly the schemaexport/update functionality (2x10 lines)

will put up a feature request in the jira

- 101


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.