Folks,
        I have a complicated bean that contains a number of collections as well as 
properties (simple and complex).  I have got all this working fine and dandy and 
mapped to my DB schema. 

However, I do not use lazy loading, as I have found that within my struts based 
webapp, where beans are queried and populated in an ActionClass, and then referenced 
in a JSP, that I get "Transaction is closed" error messages in the JSP pages.

This is fine, I'm not too pushed if individual beans are lazy loaded or not for most 
of the time.  However there is one case where I would like to lazy load - and that is 
usually when I am dealing with large collections of these beans: my db has about 4/5K 
rows, and there are times that an OQL query can bring back that many results - within 
a webapp, that can take some time to execute - my performance increases dramatically 
if I implment lazy loading....

Now I thought that I would use a pass-through SQL query instead of the OQL query to 
populate the highlevel beans, only I am getting NullPointerExceptions:

java.lang.NullPointerException
        at org.exolab.castor.jdo.engine.SQLEngine.createCall(SQLEngine.java:430)
        at org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:513)
        at org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:488)
...

What is the correct way to use pass-through SQL - I've looked at the FAQ, but am none 
the wiser...

My OQL looks like this:

oql = db.getOQLQuery("CALL SQL SELECT cardid id, name, colour, type, '', 
convertedmanacost, costid FROM cards AS org.grimoire.beans.Card");

Thanks for reading,
Pete

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to