-->
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: Hibernate hangs while raw SQL is fine
PostPosted: Fri Mar 13, 2009 7:20 pm 
Newbie

Joined: Fri Jan 26, 2007 9:46 am
Posts: 6
Hi,

Here is the point... We are currently using Hibernate 3.2.3GA above Oracle10g (release2).

Playing with criterias I'm ending up with the following SQL line (thanks to hibernate.show_sql):

select count(*) as y0_, min(this_.CREATION_TIME) as y1_, max(this_.CREATION_TIME) as y2_, count(distinct this_.REFERED_ID) as y3_ from XXXXXX.NPO_LOG_EVENT this_ inner join XXXXXX.NPO_LOG_REQUEST eventreque1_ on this_.LOG_REQUEST_ID=eventreque1_.ID inner join XXXXXX.NPO_SUPPORTER requestsup2_ on eventreque1_.SUPPORTER_ID=requestsup2_.ID where this_.EVENT_ID in (?, ?, ?) and this_.EVENT_KIND=? and this_.NPO_ID=? and requestsup2_.TESTMODE=? and eventreque1_.SUPPORTER_ID is not null and requestsup2_.STATUS=?

Which is the perfect fine SQL desired...
However, when executing it (criteria.uniqueResult()), the thread is hanging at the following position:
Code:
Daemon Thread [http-8080-Processor25] (Suspended)   
   SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) line: not available [native method]   
   SocketInputStream.read(byte[], int, int) line: 129   
   DataPacket(Packet).receive() line: not available   
   DataPacket.receive() line: not available [local variables unavailable]   
   NetInputStream.getNextPacket() line: not available   
   NetInputStream.read(byte[], int, int) line: not available   
   NetInputStream.read(byte[]) line: not available   
   NetInputStream.read() line: not available   
   T4CMAREngine.unmarshalUB1() line: 1104 [local variables unavailable]   
   T4CMAREngine.unmarshalSB1() line: 1075   
   T4C8Oall.receive() line: 480   
   T4CPreparedStatement.doOall8(boolean, boolean, boolean, boolean) line: 219   
   T4CPreparedStatement.executeForRows(boolean) line: 970   
   T4CPreparedStatement(OracleStatement).executeMaybeDescribe() line: 1072   
   T4CPreparedStatement.executeMaybeDescribe() line: 854   
   T4CPreparedStatement(OracleStatement).doExecuteWithTimeout() line: 1154   
   T4CPreparedStatement(OraclePreparedStatement).executeInternal() line: 3370 [local variables unavailable]   
   T4CPreparedStatement(OraclePreparedStatement).executeQuery() line: 3415 [local variables unavailable]   
   NewProxyPreparedStatement.executeQuery() line: 76   
   BatchingBatcher(AbstractBatcher).getResultSet(PreparedStatement) line: 186   
   CriteriaLoader(Loader).getResultSet(PreparedStatement, boolean, boolean, RowSelection, SessionImplementor) line: 1787   
   CriteriaLoader(Loader).doQuery(SessionImplementor, QueryParameters, boolean) line: 674   
   CriteriaLoader(Loader).doQueryAndInitializeNonLazyCollections(SessionImplementor, QueryParameters, boolean) line: 236   
   CriteriaLoader(Loader).doList(SessionImplementor, QueryParameters) line: 2220   
   CriteriaLoader(Loader).listIgnoreQueryCache(SessionImplementor, QueryParameters) line: 2104   
   CriteriaLoader(Loader).list(SessionImplementor, QueryParameters, Set, Type[]) line: 2099   
   CriteriaLoader.list(SessionImplementor) line: 94   
   SessionImpl.list(CriteriaImpl) line: 1569   
   CriteriaImpl.list() line: 283   
   CriteriaImpl.uniqueResult() line: 305   
   HibernateNpoLogEventDAO.extractSupporterEventsStats(NpoLogEventDAO$Filter, Date) line: 203   
   displaychart_jsp(HttpServlet).service(ServletRequest, ServletResponse) line: 802   
... and some more...   


What is puzzling me, is that when I replace the Criteria setup/uniqueResult call with a direct sql.connection / preparedstatement /resultset with the same SQL string, and same parameters, everything is going well (and fast) !

This is pretty annoying since Criteria was the API we wanted to move to (especially for reporting), and I couldn't find a way to easily 'extract' parameters & sql from the criteria. We are starting to wonder if some other criteria calls may fall under that problem !

Did anyone came accross such a problem ?


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.