Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
hi all I am quite new to hibernate and I am trying to built a test web application which can add new item to the database.
Hibernate version:
I ma using Hibernate 3.0.5
Mapping documents:
Code between sessionFactory.openSession() and session.close():
the following is the dbProc class where I place to code to save a new record. I believe I missed sth here so that it threw the 'No TransactionManagerLookup specified' exception.
package Server;
import org.hibernate.Session;
import org.hibernate.Transaction;
import OTPServer.HibernateUtil1;
public class dbProc {
/** Creates a new instance of dbProc */
public static void addUser(String userName, String passWord)
{
Transaction tx;
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
tx=session.beginTransaction();
userAuth user = new userAuth();
user.setId(userName);
user.setPassCode(passWord);
session.save(user);
tx.commit();
HibernateUtil.getSessionFactory().close();
}
}
Full stack trace of any exception that occurs:
org.hibernate.HibernateException: No TransactionManagerLookup specified
org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:503)
OTPServer.dbProc.addUser(dbProc.java:26)
OTPServer.useraddAdmin.processRequest(useraddAdmin.java:49)
OTPServer.useraddAdmin.doGet(useraddAdmin.java:67)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
Name and version of the database you are using:
I am using HypersonicSQL
thank you very much!
regards
Jason