Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:3.0[/b]
[b]Mapping documents:[/b]
[b]Code between sessionFactory.openSession() and session.close():
.......
try
{
session = HibernateUtil.currentSession();
Query query = session.createQuery("FROM User u where u.name =
:name AND u.password = :password");
query.setParameter("name", new String(name));
query.setParameter("password", new
String(computePasswordHash(password)));
user = (User)query.uniqueResult();
Date today = Calendar.getInstance().getTime();
if (user != null)
{
setName(user.getName());
setDescription(user.getDescription());
setPassword(user.getPassword());
setIsAdmin(user.isIsAdmin());
setLoginDate(user.getLoginDate());
setLockedDate(user.getLockedDate());
setLastIp(user.getLastIp());
// transaction starts, updating row in datase
tx = session.beginTransaction();
status = STATUS_VALID;
user.setLoginDate(today);
user.setLastIp(lastIp);
session.save(user);
tx.commit();
// transaction ends
}
else // No user found
status = STATUS_INVALID;
}
catch (Exception e)
{
if (tx != null)
tx.rollback();
throw new Exception(e.getMessage());
}
finally
{
HibernateUtil.closeSession();
}
[/b]
[b]Full stack trace of any exception that occurs:[/b]
[b]Name and version of the database you are using:postgresql 8.0[/b]
[b]The generated SQL (show_sql=true):[/b]
[b]Debug level Hibernate log excerpt:[/b]
My problem is that I have transactions which are pending in Posgresql log. Consequently am unable to access my database. Can anyone please tell me what's wron in the code.
thanks in advance