Hi,

I have searched this forum but could not find a match to my question, I 
apologise if it is already answered (please point me to the answer).

I recently noticed that the version number on hibernate objects gets updated on 
SELECT and return from a stateless session bean (non ejb3).

My EJB calls a 'reader' that simply returns a list via "select x from MyObject 
as x"

query.list();

and I get the session like this:
    protected Session getSession() {
        try {
            final InitialContext ctx = new InitialContext();
            final SessionFactory factory = (SessionFactory) 
ctx.lookup("java:/hibernate/SessionFactory");
            return factory.getCurrentSession();
        } catch (final NamingException e) {
            throw new HibernateException(e);
        }
    }

and the query:
query = s.createQuery("select x from MyObject as x");

My object is defined in hbm with
<version name="version" unsaved-value="negative" />

When the object is returned from the EJB, Jboss seems to update the version....

WHY??? Nothing has changed?  

Any pointer most appreciated and will earn my eternal gratitude for at least 1 
minute.

Many thanks

Benoit

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974478#3974478

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974478
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to