You wouldn’t think the difference between these two code snippets were anything to blog about, right?
String selectString = "select * from mytable"; List result = getHibernateTemplate().find(selectString);
and this one, and no, you woun’t get any points for pointing out that this is a better, non-deprectaed way of executing a query in Hibernate
String selectString = "select * from mytable"; Query query = getSession().createQuery(queryString); List result = query.list();
And no to the funny part: the latter implementation makes DBUnit hang forever!
Doing a thread dump of the Maven Surefire process reveals that this part of code is hanging:
"main" prio=10 tid=0x09945c00 nid=0x5279 in Object.wait() [0xb7d74000..0xb7d751f8] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on (a org.apache.commons.pool.impl.GenericObjectPool) at java.lang.Object.wait(Object.java:485) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:748) - locked (a org.apache.commons.pool.impl.GenericObjectPool) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
Now, who can tell me why this is?
Just passing by.Btw, you website have great content!
______________________________
Don’t pay for your electricity any longer…
Instead, the power company will pay YOU!