Thanks all for replying. <br><br>We currently already have a layer of service (DAO) to retrieve data from<br>the database. We were thinking along the line you suggested there, but<br>somehow, we have the impression that it's not quite as efficient as we<br>would like. <br><br>If we were to load the data from the database so that Rules can pick those<br>we wanted, we would have to load records in the range of hundreds of <br>thousands (or even more), which would kill our system there. It would be<br>much less expensive to do this with a single query statement.<br><br>Right now, we are thinking along the line of, say, letting the rules generate<br>a query statement on the fly, based on the result from firing the rules. But that's<br>much more complicated to achieve that just writing the SQL directly.<br><br>Now, to make things more complicated (as per the business requirements), <br>if we use rules, we have to run parts of the rules first, retrieve parts of the <br>data, then
 run the second part of the rules (which use the first part of data <br>to make decision), then retrieve next part of data, and so on. This does not <br>seem like an efficient way though. With SQL, we could write a more or less<br>complicated statement (with sub-queries and the usual suspect), and get <br>the final result in one shot.<br><br>The major issue we have with rules is that it assumes all data necessary for<br>firing the rules are in memory. This works fine for small systems (and with small<br>number of users). But right now, we couldn't figure out an efficient way to work<br>with large amount of data already in the database.<br><br>Maybe we are are not thinking in the right line of reasoning. Please help to<br>point out what's wrong.<br><br>If someone had experience dealing with large database system and is willing to<br>share the experience, that would be really appreciated.<br><br>We are currently using Rules v3.0.5. Will try the
 v3.1.0.<br><br>Best,<br><br><b><i>Marcus Ilgner &lt;marcus.ilgner@gmail.com&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><UKamath@dharbor.com><br>That's probably the best solution. Using the current version (3.1M1),<br>you can use the FROM keyword to reference facts from List object<br>returned from a method call on a service, for example.<br>Something like this works very good in my current testing project:<br><br>rule foobar<br>when<br>  MyObject( someValue = "foobar" ) from MyObjectDAO.loadAll()<br>then<br>...<br>end<br><br>The DAO then uses Hibernate to load some objects and returns a<br>List<MyObject> which can be used by Drools.<br>As Uday already wrote, you could also write a DAO which retrieves<br>arbitrary objects using a given HQL statement.<br><br>Best
 regards<br>Marcus<br>_______________________________________________<br></MyObject></UKamath@dharbor.com></blockquote><br><p>&#32;

<hr size=1>No need to miss a message. <a href="http://us.rd.yahoo.com/evt=43910/*http://mobile.yahoo.com/mail
">Get email on-the-go </a><br>with Yahoo! Mail for Mobile. <a href="http://us.rd.yahoo.com/evt=43910/*http://mobile.yahoo.com/mail
">Get started.</a>