Hi, Yesterday I created a Jira issue at https://issues.apache.org/jira/browse/ARIES-765
I think my question is a bit philosophical so the mail list might be a better place to ask it. We are planning to release the first stable version of our opensource libraries soon that implements the following idea: We have entity classes in different jars like: - Authorization entities - Authentication entities - Localized data entity (to have the same possibilities as ResourceBundle but in database) - ... The programmer must create a Persistence Unit project and use list the entity classes in persistence.xml he wants to use. Programmers should use JPA criteria API always. What we win: - Authorization: - We add a criteriaBuilder, a CriteriaQuery and a Root to a static function and it will append the query to have authorization in it - Localized Data: - We add a criteriaBuilder, a CriteriaQuery and a Path to a static function and it will append the query to have a Selection with a COALESCE subquery using the same functionality as ResourceBundle (en_US, en, default lang...) - ... With these logic we can append our SQL statements pretty easily with commonly used functionality in the way that we can order the query or we can use range selections (setFirst, setMax). Our experience was always that having a database query may be a difficult one but it is always much faster to do the authorization and ordering inside the query and not on Java side. Especially when we need only 10-100 rows from a million resultset... I always felt that modularization gives me the possibility to update as less bundles (and classes) as it is possible. If I take the entity classes of the different projects into one pu jar I may have the same classes and packages (same version) in different jars. Another thing that I am thinking since months: I have the following: Web -> Service1 -> Service2 -> Service3 -> PU Service1 and service2 could really be database independent. Do I really have to drop Service2 and Service3 bundles twenty times if I want to use them in twenty different applicaiton with a differnt PU. Is there any solution where I really have to drop the same packages (with the same version) only ones into an OSGI container? In this case I can only think of a thread local variable which is set when a request comes in and a very flexible EntityManager implementation in the PU project that uses this thread local. I would be very interested about others opinion (especially OSGI experts) and if there is any other solution that gives us these kind of possibilities. I personally do not really like the kind of solution that we have a big zip with jar files in it as in that case I will feel that I go back to war and ear development that I wanted to leave (due to slow deployment and big permgen...) Thanks for the answers, Balazs
