-->
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: Unsafe cast code in DetachedCriteria.GetExecutableCriteria
PostPosted: Sat Mar 24, 2007 4:26 pm 
Beginner
Beginner

Joined: Sun Jun 19, 2005 2:21 pm
Posts: 21
Hello,

While trying to use NHibernate with Spring.NET's HibernateTemplate, I have encountered a nasty invalid cast exception due to unsafe cast code in DetachedCriteria.GetExecutableCriteria.

session input parameter is proxied in Spring.NET an cannot be casted to SessionImpl class.

The offending NHibernate code is prone to such casts exceptions in case that the class implementing ISession is not of type SessionImpl. I've searched through entire codebase and this cast is the only of this kind.

NH team please correct the GetExecutableCriteria to work properly.

Code:
      /// <summary>
      /// Get an executable instance of <c>Criteria</c>,
      /// to actually run the query.</summary>
      public ICriteria GetExecutableCriteria(ISession session)
      {
            impl.Session = (SessionImpl)session;
         return impl;
      }




Regards,
Robert


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 25, 2007 2:11 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Please submit a bug report, ideally with a simple test case (i.e. one that doesn't introduce a dependency on Spring.NET). Also please indicate which version you are using.


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.