tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Gumbrecht <andy.gumbre...@orprovision.com>
Subject Re: Multiple instances of OpenEJB - New strategy
Date Fri, 09 Oct 2009 06:41:19 GMT
Thanks David,

Just what I was looking for!

I do love the oranges and limes - for some reason I always use bob, jane 
and if I get stuck for a third sally.. I guess you could use lemons :-)

Cheers.

On 09.10.2009 07:40, David Blevins wrote:
>
> On Oct 8, 2009, at 2:11 AM, Andy Gumbrecht wrote:
>
>> However, I think that a better more lightweight option is to have one 
>> OpenEJB embedded instance that provides access to EJBs that in turn 
>> obtain EntityManagers from EntityManagerFactories bound to the 
>> corresponding PU cache determined by the call context. I would 
>> replace the @PersistenceUnit on EJBs with an @EJB helper to lookup 
>> and provide the EMs to the EJBs.
>>
>> What I would really like to do is sew in a new named persistence unit 
>> dynamically at any time 'after' start up of OpenEJB - including the 
>> dynamic DataSources.
>>
>> This leads to the new question - Is it possible to directly access 
>> OpenEJB (Assembler assembler = 
>> SystemInstance.get().getComponent(Assembler.class);) and create or 
>> define a new PU on the fly? - Using appInfo.persistenceUnits.add() 
>> for example. Is that safe?
>
> If you wanted to tinker around in the low level internal code, yes, 
> you can do some pretty crazy stuff dynamically :)  Be warned however 
> we reserve the right to change them without notice.
>
> So all disclaimers aside, if you really want to be naughty, this test 
> case is a good (er, I mean, bad, very bad, shame on you for even 
> looking) example of how things look internally when we deploy an app 
> with a persistence unit:
>
> http://svn.apache.org/repos/asf/openejb/tags/openejb-3.1.1/container/openejb-core/src/test/java/org/apache/openejb/config/AutoConfigPersistenceUnitsTest.java

>
>
> In your situation you'd already have an Assembler there, so skip 
> everything we do in the setUp() of the test case with one exception.  
> You'll still need to create a 'new ConfigurationFactory();'
>
> The other option is that we do support multicast discovery in the 
> client and server.  Not sure how that might play into your goal, but 
> might open some doors if you need the client to dynamically failover 
> to another server.
>
> -David
>
>
>


-- 
------------------------------------------------------------------------

*Andy Gumbrecht*
Software Developer
Orpro Vision GmbH
Hefehof 8, 31785, Hameln

Tel +49 (0) 5151 809 44 21
Cell +49 (0) 174 1800 381
Email andy.gumbrecht@orprovision.com
Web www.orprovision.com


            Orpro Vision GmbH
            Sitz der Gesellschaft: 31785, Hameln
            USt-Id-Nr: DE264453214
            Amtsgericht Hannover HRB204336
            Geschaeftsfuehrer: Roberto Gatti

------------------------------------------------------------------------


            Diese E-Mail enthält vertrauliche und/oder rechtlich
            geschützte Informationen. Wenn Sie nicht der richtige
            Adressat sind oder diese E-Mail irrtümlich erhalten haben,
            informieren Sie bitte sofort den Absender und vernichten Sie
            diese Mail. Das unerlaubte Kopieren, jegliche anderweitige
            Verwendung sowie die unbefugte Weitergabe dieser Mail ist
            nicht gestattet.

------------------------------------------------------------------------


            This e-mail may contain confidential and/or privileged
            information. If you are not the intended recipient (or have
            received this e-mail in error) please notify the sender
            immediately and destroy this e-mail. Any unauthorized
            copying, disclosure, distribution or other use of the
            material or parts thereof is strictly forbidden.

------------------------------------------------------------------------



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message