db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michelle Caisse (JIRA)" <j...@apache.org>
Subject [jira] Created: (JDO-138) Cache pmf instances
Date Mon, 19 Sep 2005 17:28:27 GMT
Cache pmf instances

         Key: JDO-138
         URL: http://issues.apache.org/jira/browse/JDO-138
     Project: JDO
        Type: Improvement
  Components: tck20  
    Reporter: Michelle Caisse

In order to improve performance with connection pooling, cache pmf instances in JDO_Test,
rather than closing pmf after each test.

Some design issues & suggestions:

It might be worthwhile looking at the JDO_Test method where the PMF is acquired. Perhaps a
static Map that holds the PMF between tests would work. The thing to watch for is to make
sure that the PMF that's cached fully meets the requirements of the Properties/Map that is
being used. There is some logic there.
The reason to close the pmf is to gracefully close the underlying files. This was a requirement
of the original FOStore implementation, and I don't remember exactly why we wanted to do that,
but we did.

It's worth experimenting with this to see if we can avoid closing the PMF in case we are running
multiple tests. 

We might need a maven postGoal to close the pmf after all the tests have run.

We could adapt a policy of not closing pmf, but only those tests which require an explicit
closing of pmf would call closePMF() or something like this which would
1. explicitly close the pmf in cache (pmf.close())
2. flush the cache.
For [tests that need to set pmf properties], we could have a setPMF(Properties props) and
closePMF() methods in JDO_Test which will modify the cache appropriately.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message