[jboss-user] [JBoss Seam] - JDBC error in Factory class
armita
do-not-reply at jboss.com
Wed Aug 30 03:41:13 EDT 2006
Trying to execute a query in a Factory method I get this error:
| 2006-08-30 11:59:27,495 DEBUG [org.hibernate.util.JDBCExceptionReporter] Cannot open connection [???]
| org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=sky/81, BranchQual=, localId=81]; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=sky/81, BranchQual=, localId=81])
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
| at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
| at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
| at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
| at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
| at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
| at org.hibernate.loader.Loader.doQuery(Loader.java:661)
| at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
| at org.hibernate.loader.Loader.doList(Loader.java:2145)
| at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
| at org.hibernate.loader.Loader.list(Loader.java:2024)
| at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
| at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
| at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
| at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
| at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
| at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:53)
| at ist.itl.services.RosterImpl.termFactory(RosterImpl.java:151)
|
The method looks like:
| @Factory("terms")
| public void termFactory(){
| termId = 0;
| terms = entityManager.createQuery("from Term t where t.campus=:campus order by t.startDate desc")
| .setParameter("campus",sessionUser.getInstance().getCampus())
| .getResultList();
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968294#3968294
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968294
More information about the jboss-user
mailing list