-->
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: Sotred Procedure Cach expired Object Loading
PostPosted: Sat May 21, 2005 5:31 am 
Newbie

Joined: Sun Apr 03, 2005 6:47 pm
Posts: 6
Hi,

I am trying to use MS SQL Stored Procedures (SQL 2K) )from Hibernate.(Hibernate 3.0.3)


My named query is cached.
(With a Default Region + Default Settings)

My First time load is working without error.
When I try to access it second time I get a the following error.
From Log I can see that the the "UpdateTimestampsCache" is getting missed. After that It tried to load the object from the database.

The initial loading was done using Stroed Procedure and the second time Hiberante tries to load it using normal "SQL" which it is not supposed to do.
It is suppoed to use the StoredProcedure to load the objects.

What am I doing wrong?


Thanks,
patkeep.


FYI:-------



org.hibernate.exception.SQLGrammarException: could not load an entity: [PCode#1]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:59)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1285)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:141)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:126)
at org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2496)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:387)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:368)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:166)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:140)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:119)
at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:577)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:59)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:80)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:134)
at PCode$$EnhancerByCGLIB$$d1a01281.getProcedureCode(<generated>)
at MCode.load(LoadNomenclatures.java:89)


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 23, 2005 12:20 pm 
Newbie

Joined: Sun Apr 03, 2005 6:47 pm
Posts: 6
Hi,

After doing some research myself I found that it has to do with the cache miss event.

If the Stored Procedure Query cache not expired but the underline object's cache is expired then it tried to use a normal sql instead of making a Stored Procedure call.


It end up thowing the above stack trace.

Here is the second part of the stack trace..(Which I mssied in the earlier post)


Caused by: com.inet.tds.SQLException: Msg 208, Level 16, State 1, Line 1, Sqlstate S0002
[SQLBOX]Invalid object name 'AutoId'.
at com.inet.tds.a.a(Unknown Source)
at com.inet.tds.g.if(Unknown Source)
at com.inet.tds.g.a(Unknown Source)
at com.inet.tds.g.for(Unknown Source)
at com.inet.tds.c.int(Unknown Source)
at com.inet.tds.c.executeQuery(Unknown Source)
at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:68)
at org.logicalcobwebs.cglib.proxy.Proxy$ProxyImpl$$EnhancerByCGLIB$$971ccf12.executeQuery(<generated>)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:118)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1197)
at org.hibernate.loader.Loader.doQuery(Loader.java:366)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:206)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1271)


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.