Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1
Mapping documents:
hibernate.cfg.xml
Code between sessionFactory.openSession() and session.close():
This is where we are unclear. We were using the out of box driver from sybase but it lacked much functionality. We are using Jboss 4.0.2. We want to take advantage of Jboss JTA management for our sessions and transactions. We were explicitly opening a session on every call to the db, flushing, closing in short, all management was ours. This was terrible and performance was poor. We have implemented the driver from data direct at the recommendation of someone from this site. We are now having issues b/c of how we were doing things. Can someone give me a clean example of exactly how a HibernateUtil class would be written using the Jboss JTA? My understanding is that when Jboss comes up we create a sessionFactory and a UserTransaction. Then we use this sessionFactory to open a session. When is the best time to do this? Thanks in advance.
Full stack trace of any exception that occurs:
Name and version of the database you are using:
sybase ASE 12.5
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
can not load entity (this is the first time we are trying to query to the db) We were using the hibernate beginTransaction() call. After we opened a new session each time. Example of our method descriptor:
public Analyst findBySids(Session session, String sid)
{
Criteria criteria =
session.createCriteria(Analyst.class);
analyst = (Analyst) criteria.uniqueResult();
}
In brief.