-->
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.  [ 2 posts ] 
Author Message
 Post subject: Freeze up on reload/session.invalidate
PostPosted: Mon Mar 22, 2010 7:12 am 
Newbie

Joined: Mon Mar 22, 2010 6:57 am
Posts: 6
I an trying to write a webapp from scratch and I encountered this problem using hibernate.

When I logout and do a session.invalidate OR I hit F5 to refresh the page, succeeding calls to hibernate results in a lock up.

I am using spring 2.5, hibernate 3, and hsqldb 1.8.

PLease enlighten me on what I am missing.

here is a sample call to hibernate:
Code:
    protected <T extends AbstractBean> T readObject(final String identifier, final Map<String, Object> map) {
        return (T)getHibernateTemplate().execute(new HibernateCallback() {
            @Override
            public Object doInHibernate(Session session) throws HibernateException, SQLException {
                session.enableFilter("patchFilter");
                Query query = session.getNamedQuery(identifier);
                for (String key : map.keySet()) {
                    Object obj = map.get(key);
                    Class type = obj.getClass();
                    try {
                        Query.class.getMethod("set" + type.getSimpleName(), new Class[] { String.class, type }).invoke(
                                query, new Object[] { key, obj });
                    } catch (Exception e) {
                        throw new RuntimeException("Illegal argument [" + key + "," + obj + "]");
                    }
                }
                return query.uniqueResult();
            }
        });
    }


here is my hibernate config
Code:
<hibernate-configuration>
    <session-factory>
        <!-- Database connection settings -->
         ...

        <!-- JDBC connection pool (use the built-in one) -->
        <property name="connection.pool_size">100</property>

        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class">thread</property>

        <!-- Disable the second-level cache  -->
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

        <!-- disable batching so HSQLDB will propagate errors correctly. -->
        <property name="jdbc.batch_size">0</property>

        <property name="show_sql">true</property>

<!-- -mapping files ....->
    </session-factory>
</hibernate-configuration>



Top
 Profile  
 
 Post subject: Re: Freeze up on reload/session.invalidate
PostPosted: Mon Mar 22, 2010 8:20 am 
Newbie

Joined: Mon Mar 22, 2010 6:57 am
Posts: 6
Sorry for wasting your time.
I figured out the problem, it appears I have a java exception that is silently being thrown.
Please delete my post.
Thank you.


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

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.