Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 rewrite minerva statement caching

closed-accepted
Bill Burke
None
5
2003-09-09
2001-04-05
Bill Burke
No

I rewrote the statement caching in Minerva for a number
of reasons:( tar attached)

- Make the allowable open statements configurable from
jboss.jcml
- Consolidate statement caching logic into one class
for less code duplication
- To be able to keep track of all open statements a
connection has so that we release prepared statements
when a maximum of allowed open statements(plain
Statements plus PreparedStatements) is reached.

What did I change?

- You can configure the maximum allowable open
statements by putting in a property in the Properties
tag in the XADataSourceLoader xml stuff in jboss.jcml

<attribute
name="Properties">MaxOpenStatements=99</attribute>

"-1" value means caching is turned off
"0" value means caching is unlimited

- org.opentools.minerva.jdbc.StatementFactory contains
all the logic for statement creation and caching.
Prepared statements only are cached, but all open
statements are counted. If a createStatement will put
the open statements over MaxOpenStatements, then a
prepared statement will be closed and released from the
cache.

- ConnectionInPool and XAClientConnection delegate to a
StatementFactory for creating, preparing and closing
statements.

- there is no longer a psCaches HashMap contained in
ConnectionInPool as a static variable. This is instead
renamed to sfCaches and hold a hashmap of connections
to StatementFactories.

- XADataSourceImpl reads the properties and extracts
MaxOpenStatements. I also remove MaxOpenStatements
from the Properties so that the JDBC driver doesn't get
screwed up by a property it doesn't understand.

Tell me what you think, and if you need more
information please let me know. I have tested the code
with caching turned on and off and unlimited and it
seems to work pretty good with the application we're
writing to JBoss. Let me know if you think these
changes are relevant.

Regards,
Bill

Discussion

  • Bill Burke
    Bill Burke
    2001-04-05

    full modified minerva source

     
    Attachments
  • Juha Lindfors
    Juha Lindfors
    2001-04-11

    • assigned_to: nobody --> patriot1burke
    • status: open --> open-accepted
     
  • Juha Lindfors
    Juha Lindfors
    2003-09-09

    • status: open-accepted --> closed-accepted