Hi,
I've tried to use JDBCStoreManager.RefCountConnection but it's actually
quite unfriendly for reuse, I mean, it's a protected inner class and is
related to private static fields and initialization. Even attempting to
subclass JDBCStoreManager is hard, besides of missing the point.
For now I'll keep using my modified copy of SchemaGenerator, even
without proper connection cleanup. If I reach a point where I get a nice
working plugin, it will hopefully be a good case to justify upstream changes
in SchemaGenerator.
Thanks for your help,
Daniel
Michael Dick wrote:
>
> I'd have to look at the code paths involved, but in the 'mainline' code we
> wrap the real connection in a RefCountConnection. RefCountConnection
> maintains a count of the number of times it's been handed out decrementing
> it when ever it's closed. The real connection won't be closed until the
> counter reaches 0.
>
> If we create the same wrapper in the SchemaGenerator then you should be
> able
> to get the connection in the main method (incrementing the count) and then
> close it at the end.
>
> If everything's working right the individual methods will get the same
> connection - the count won't drop to 0 until the end of the main method
> and
> you should be okay.
>
> Something along those lines should be feasible, and with some luck you
> won't
> have to change any signatures along the way.
>
--
View this message in context:
http://n2.nabble.com/SchemaGenerator-and-connections-tp4852136p4885851.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.