-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem with StatelessSession insert
PostPosted: Mon Aug 09, 2010 11:47 am 
Newbie

Joined: Sat May 02, 2009 7:18 pm
Posts: 2
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.