Hello,
I have a strange problem with StatelessSession, if anyone can help me.
Basically, what happens to me, is that, records inserted via StatelessSession insert, are not visible when I query for them, via regular Session.
I know that StatelessSession bypasses normal hibernate functionality, however I find it strange, that I cannot get those records, no matter what I do.
Please note :
- I explicitly call StatelessSession.beginTransaction, to begin a new transaction;
- I explicitly call StatelessSession.getTransaction().commit() to commit the transaction.
- After this, I am using a regular statefull session (as provided by getHibernateTemplate().getSessionFactory().getCurrentSession() ), to simply list all the entries previously inserted.
Code is like this :
Code:
session.createCriteria(XLeague.class)
.setCacheMode(CacheMode.IGNORE)
.list();
Resultset is empty.
- I am sure that records are correctly inserted into database.
- I already tried to call StatelessSession.close(), but this doesn't seem to help me very much.
- I already tried to make Session.createSQLQuery, to count records into database, and the result is zero.
I am using Hibernate 3.3.1, in conjunction with spring mvc; db is mysql5
Kind regards,
Andrei