openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey (JIRA)" <>
Subject [jira] Commented: (OPENJPA-160) Reuse BrokerImpl objects
Date Tue, 27 Feb 2007 17:24:05 GMT


Patrick Linskey commented on OPENJPA-160:

> Patrick - I'll pull your patch and we'll test it out here today on the benchmark.

Cool -- I'm looking forward to seeing the results.

> My only question is whether this pattern exists anywhere else or only in 
> ObjectValue. That might argue for making InstanceFactory a more general 
> interface instead of being a member of ObjectValue.

I thought about that, and decided to just keep it in ObjectValue until we discover the need
for it elsewhere.

> As you've coded it, each instance of ObjectValue gets its own Map. Does a 
> given instance need more than one factory? It could just be stored as a 
> member instead of a Map.
> On the other hand, if the Map is static, it should probably be a Concurrent Map 
> and account for garbage collecting undeployed classes.

I put a Map in place to get around any ClassLoader issues. In the common case, it shouldn't
be an issue, since all the built-in OpenJPA classes will presumably  be in the same classloader
as the ObjectValue class. But the existing code handled more complex ClassLoader situations,
so I figured I'd preserve that feature.

The set-up happens during BrokerFactory initialization, so there is no real need to make it
static. Making it static might speed things up between multiple BrokerFactories, but I like
having different BrokerFactories be independent.

> Reuse BrokerImpl objects
> ------------------------
>                 Key: OPENJPA-160
>                 URL:
>             Project: OpenJPA
>          Issue Type: Sub-task
>            Reporter: Michael Dick
>         Attachments: openjpa-160-patch.txt, perf2.jpg, perf3.jpg

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message