I have treid with:
SessionFactoryImpl session = (SessionFactoryImpl) getSession().getSessionFactory();
return session.getSettings().getConnectionProvider().getConnection();
in jsp i take the connection, execute the query and build the list.
after i can't do nothing because i have this exception:
javax.servlet.ServletException: com.XXXX.utils.ejb.DaoException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a3c0225:95e4:499d2bf1:3c2 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a3c0225:95e4:499d2bf1:3c2 status: ActionStatus.ABORT_ONLY >))
My idea is similar to:
Session sess=sf.openSession();
Statement st=sess.connection().createStatement(); //connection is deprecated
String sql="select * from foo";
st.executeQuery(sql);
i wait new helps...
thanks to all
_________________ -------------------------------------
La realizzazione di un sogno
aiuta l'animale uomo a vivere
con dignità
-------------------------------------
|