Ive had reason to move my code from using load and loadDeep to executing
sparql - I need to filter the individuals returned based on a status
property. I now construct the sparql and pass to exec. However Im
finding that the collection properties on the object returned are
"LazySets" and when I "getMyCollection()" property on the object Im
getting strange SQL exceptions. Whats going on ???
2010-07-21 16:28:23,981 [main] WARN sql.SDBConnection - execQuery:
SQLException
Connection is closed.
SELECT -- V_1=?o
R_1.lex AS V_1_lex, R_1.datatype AS V_1_datatype, R_1.lang AS
V_1_lang, R_1.type AS V_1_type
FROM
Pulling my hair out now.
Sent from my HTC
Hi,
--
You received this message because you are subscribed to the Google Groups "jenabean-dev" group.
To post to this group, send email to jenabe...@googlegroups.com.
To unsubscribe from this group, send email to jenabean-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jenabean-dev?hl=en.
Ive tried in 1 to force the collections in lazy sets and list to be
loaded by reflecting on the objects and doing a method invoke on getters
that are assignable from LazySet|LazyList. This seems to work at the web
tier - I can call the collection getters without getting a connection
closed sql exception. But - if I try and serlialize these as json by
passing the Jackson (Im using Spring3), things go bad again.
Is there a way around this, or an alternative way of doing a deep or at
least one-level-deep collection load on objects, or is there a way to do
more than a simple read of objects of a certain class - "get me objects
of type x where property a=y" - without having to use exec ?
OSIV ?
Rolled my own connection-per-thread filter to emulate OSIV, but have
come a cropper now with requests being forwarded to JSP/Jackson once the
domain objects have been retrived with lazy load exec(). Request
dispatcher is forwarding to jsp on a different thread or Tomcat isnt
following my configuration to invoke filters on forwards so Im
pessimistic that Im going to solve this. Even tried a Spring JPA entity
manager factory with a Datasource capable jpaDialect, but this just
messed with SDB and I ended up with hung app and corrupt data.
My alternative is to walk the domain object and convert to a view object
before handing it off to JSP/Jackson or do something different and wipe
out a lot of code and effort over the past few months.
Any suggestions ?
Looks like its my Authentication code - logged in user is cached,
subsequent requests expect all info to be available, but connection is
closed by then. Have reverted this to loadDeep and added app logic to
check things that the exec query would have filtered out. Now just have
to find out why exec on the rest seems to be about 10x slower than loadDeep.