[rules-users] Hibernate Query delivers wrong values

Greg Barton greg_barton at yahoo.com
Fri Jul 10 10:37:50 EDT 2009


Yes, Hibernate caches in several ways.  Go here:

http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/

Search for "cache". :)  

Some caching you can disable. (The 2nd level session factory cache.)  

http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional-cacheprovider

The cache on the session cannot be disabled, but you shouldn't be using hibernate sessions for the long term anyway. (i.e. a new one should be opened up each time the rule condition is evaluated.)

--- On Fri, 7/10/09, Thomas Zwifl <tom238 at gmx.at> wrote:

> From: Thomas Zwifl <tom238 at gmx.at>
> Subject: [rules-users] Hibernate Query delivers wrong values
> To: rules-users at lists.jboss.org
> Date: Friday, July 10, 2009, 5:46 AM
> Hi there!
> 
> I'm working with the latest snapshot-releas of v5.1
> (build3098-rev27324-20090630-0403).
> My application consists of two independent processes, 
> both are repeated periodically (timer-node).
> the processes both have ruleset-nodes. some rules are
> querying a database with hibernate in the rule condition
> (LHS).
> the queried objects are then inserted into workinmemory
> (insert(object)), 
> then some computation follows, the objects are modified and
> written
> back to db, and then the objects are retracted
> (retract(object)).
> 
> Now to the problem: when I start the application,
> everything works 
> correct, and leads to the right results. But when I change
> a field of a
> db-record manually, the hibernate-query delivers the old
> values!!
> (of course the changes are committed.)
> 
> Anyone has an idea whats going wrong here? Is there some
> kind of 
> caching mechanism that delivers the old objects instead of
> querying
> the database?
> 
> greetz!
> tom 
> -- 
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 


      




More information about the rules-users mailing list