Impetus / kundera

A JPA 2.1 compliant Polyglot Object-Datastore Mapping Library for NoSQL Datastores.Please subscribe to:
http://groups.google.com/group/kundera-discuss/subscribe
Apache License 2.0
902 stars 234 forks source link

Custom Class Loader #1

Open anismiles opened 13 years ago

anismiles commented 13 years ago

Kundera builds up Meta information objects for each entity involved, and later uses Reflection to play with fields and methods. Well, this works fine, but doesn't look very elegant. I propose to write a custom class loader for Kundera which would perform these tasks? This would be more in control and would scale pretty well for new usecases. suggestions? -Animesh

xamry commented 13 years ago

Hi Animesh - Currently we are using ClasspathReader class that that scan all classes in the java class path as well as "class" tags declared in persistence.xml. One more next step is to add support for "jar-file" tag and scan classes from jar file. I agree that this whole process should be better designed. Is this changing way we scan entity classes that you are suggesting.

anismiles commented 13 years ago

Right. Currently, we employ ClassReader (inspired from another library: http://code.google.com/p/annovention/) to read the annotations and generate meta Info. Internally, it uses the default class-loading hierarchy and hence objects get chained together rather more solidly and that influences garbage collection. Under heavy load, this might burst.

What I am suggesting is to create a custom class loader for all Entity and related beans. This class loader will run all the data insertion logic etc. and would ensure that they are weakly linked together. Kuundera doesn't immediately need this, but it might prove to be a good addition.

-Animesh

mevivs commented 13 years ago

+1 for this. We should park it as of now. But will be a good stuff.

mevivs commented 12 years ago

Working on some stuff related to this now

-Vivek