SDriverOracle OffesetStrategy

Franck Routier <[email protected]> Fri, 01 Oct 2010 13:55:03 +0200
Newsgroups gmane.comp.java.orm.simpleorm
Organization Axège sarl
Message-ID <1285934103.5416.15.camel@franck-laptop>
Hi,

I am bitten by an oom exception using offset/limit with SDriverOracle.
The driver uses SDriver.OffsetStrategy.JDBC. The was done assuming (from
various reading but without any evidence) that the Oracle Driver was
smart enought to use a cursor on the server side to handle this.

But I definitely get an oom caused by OracleResultCacheImpl eating all
memory.

So I searched again and found this, on
http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/resltset.htm#CIHCHBJB

"Oracle JDBC Implementation for Result Set Scrollability

Because the underlying server does not support scrollable cursors,
(sic!) Oracle JDBC must implement scrollability in a separate layer.

It is important to be aware that this is accomplished by using a
client-side memory cache to store rows of a scrollable result set.

Important:
Because all rows of any scrollable result set are stored in the
client-side cache, a situation where the result set contains many rows,
many columns, or very large columns might cause the client-side Java
Virtual Machine (JVM) to fail. Do not specify scrollability for a large
result set."


So it seems that Oracle is not any smarter than Postgresql is, and that
resorting to a limit clause in the sql (SDriver.OffsetStrategy.QUERY)
would be a better solution for Oracle as well.

So I propose to change the SDriverOracle to implement this strategy.
Does it sound ok ?


Franck



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/