Hi all,

we are using a H2 database (1.3.161) embedded in jboss 7.1.1.Final.
We wanted to cache the prepared queries but without caching the result of 
it. Therefore we set OPTIMIZE_REUSE_RESULTS=0.
But unfortunately there is another reference-chain from the 
PreparedStatement to its result. This yields in keeping all the big results 
in memory.

My questions are:
- Is this a (known) bug (which might be fixed in a newer version)?
- Is 1.3.172 running in jboss 7.1.1.Final? So may I replace the jar with 
the newer one?

Thank you for your help,
Flo


*Detailed information:*

The jboss-configuration is:
<datasources>
                <datasource jndi-name="java:/TestDS" pool-name="TestDS" 
enabled="true" use-java-context="true">
                    
<connection-url>jdbc:h2:mem:test;REFERENTIAL_INTEGRITY=0;LOG=0;MULTI_THREADED=1;OPTIMIZE_REUSE_RESULTS=0;DB_CLOSE_DELAY=-1;QUERY_CACHE_SIZE=0;DEFAULT_LOCK_TIMEOUT=1000</connection-url>
                    <driver>h2</driver>
                    
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                    <pool>
                        <min-pool-size>1</min-pool-size>
                        <max-pool-size>12</max-pool-size>
                        <prefill>true</prefill>
                    </pool>
                    <timeout>
                        
<blocking-timeout-millis>30000</blocking-timeout-millis>
                        <idle-timeout-minutes>1</idle-timeout-minutes>
                    </timeout>
                    <statement>
                        
<prepared-statement-cache-size>100</prepared-statement-cache-size>
                        
<share-prepared-statements>true</share-prepared-statements>
                    </statement>
                </datasource>
                <drivers>
                    <driver name="h2" module="com.h2database.h2">
                        
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                </drivers>
</datasources>

The reference-chain is the following:
org.h2.jdbc.JdbcPreparedStatement.command
-> org.h2.command.CommandContainer.prepared
-> org.h2.command.dml.Select.topTableFilter
-> org.h2.table.TableFilter.cursor
-> org.h2.index.IndexCursor.cursor
-> org.h2.index.ViewCursor.result
-> org.h2.result.LocalResult containig all the data of the result

Maybe result in ViewCursor should be set to null after usage?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to