hi,
please tell me why the heck hibernate is not persisting anything but "acts" like it is working correctly
here is the deal:
Code:
User user = new User();
user.setLogin(login);
user.setPassword(password);
Session session = sf.openSession();
session.save(user);
session.flush();
session.close();
this works like it should. no exceptions AND the user.id (integer using generator="sequence" gets increased [even on the database]) BUT nothing ever makes it into the db .. show_sql shows:
Code:
Hibernate: select nextval ('uid_sequence')
Hibernate: insert into users (login, password, id) values (?, ?, ?)
my connection on the sql server says (SELECT COUNT(*) FROM users) == 0
one thing a query for the just "persisted" object works .. eg.
Code:
session.find("from User as user where user.login = ?", login, Hibernate.STRING);
finds that objects UNTIL i restart the server. then everything is like before .. so i have a nice memory only persister .. w00t.
so i thought its because of a transaction .. oh wait i havent registered/configured any BUT my sql server (PostgreSQL) shows "idle in transaction". i run a standalone application .. no app server whatsoever. heres my config:
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">jdbc:postgresql://super.duper.host.com/db</property>
<property name="hibernate.connection.username">omfg</property>
<property name="hibernate.connection.password">secret</property>
<!-- properties -->
<property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
<property name="show_sql">true</property>
<!-- mapping files -->
<mapping resource="mapping/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>
please someone tell me how to configure hibernate so that i get:
no pooling
no transactions
no caching
nothing else BUT a simple persister that does what it should?
thanks.
i'm just 1 step away from writing hand crafted plain old jdbc again.