You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Berry25 <du...@seznam.cz> on 2009/04/02 20:08:27 UTC
Re: Embedding Openejb
I am sorry, i absolutelly forgot about it.
I´d like to ask somebody. I use for to get EntityManagerFactory and
EntityManager this piece of code
..
context =
SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext();
...
factory = (EntityManagerFactory)
context.lookup("/openejb/PersistenceUnit/EJBProject 2026069911");
EntityManager em= factory.createEntityManager();
Is there any better way how to get an EntityManager or an
EntityManagerFactory ?
thanks for your suggest
Newgro wrote:
>
> Your problem is
>
> Connection refused: connect
>
> MySQL running? User Password correct? Do you use a firewall?
>
> Cheers
> Per
>
>
--
View this message in context: http://www.nabble.com/Embedding-Openejb-tp22802864p22853879.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Embedding Openejb
Posted by Per Newgro <pe...@gmx.ch>.
lol David.
Cheers
Per
Re: Embedding Openejb
Posted by David Blevins <da...@visi.com>.
Please email users-unsubscribe@openejb.apache.org to unsubscribe.
On Apr 3, 2009, at 5:41 AM, Olutosin Idowu wrote:
>
> Mr. Blevins, please stop sending these unwanted mails
>
>> From: david.blevins@visi.com
>> To: users@openejb.apache.org
>> Subject: Re: Embedding Openejb
>> Date: Thu, 2 Apr 2009 11:50:09 -0700
>>
>> On Apr 2, 2009, at 11:08 AM, Berry25 wrote:
>>
>>>
>>> I am sorry, i absolutelly forgot about it.
>>> I´d like to ask somebody. I use for to get EntityManagerFactory and
>>> EntityManager this piece of code
>>> ..
>>> context =
>>> SystemInstance
>>> .get().getComponent(ContainerSystem.class).getJNDIContext();
>>> ...
>>>
>>> factory = (EntityManagerFactory)
>>> context.lookup("/openejb/PersistenceUnit/EJBProject 2026069911");
>>>
>>> EntityManager em= factory.createEntityManager();
>>>
>>>
>>> Is there any better way how to get an EntityManager or an
>>> EntityManagerFactory ?
>>
>> I'd recommend this technique over the direct lookup as the above code
>> is guaranteed to break at some point.
>>
>> http://www.nabble.com/Re%3A-Obtaining-an-EntityManager-instance-outside-an-EJB-p21701466.html
>>
>>
>> -David
>>
>>
>>>
>>> thanks for your suggest
>>>
>>>
>>>
>>>
>>> Newgro wrote:
>>>>
>>>> Your problem is
>>>>
>>>> Connection refused: connect
>>>>
>>>> MySQL running? User Password correct? Do you use a firewall?
>>>>
>>>> Cheers
>>>> Per
>>>>
>>>>
>>>
>>> --
>>> View this message in context: http://www.nabble.com/Embedding-Openejb-tp22802864p22853879.html
>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>
>>>
>>
>
> _________________________________________________________________
> Windows Live™: Keep your life in sync.
> http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009
RE: Embedding Openejb
Posted by Olutosin Idowu <ol...@hotmail.com>.
Mr. Blevins, please stop sending these unwanted mails
> From: david.blevins@visi.com
> To: users@openejb.apache.org
> Subject: Re: Embedding Openejb
> Date: Thu, 2 Apr 2009 11:50:09 -0700
>
> On Apr 2, 2009, at 11:08 AM, Berry25 wrote:
>
> >
> > I am sorry, i absolutelly forgot about it.
> > I´d like to ask somebody. I use for to get EntityManagerFactory and
> > EntityManager this piece of code
> > ..
> > context =
> > SystemInstance
> > .get().getComponent(ContainerSystem.class).getJNDIContext();
> > ...
> >
> > factory = (EntityManagerFactory)
> > context.lookup("/openejb/PersistenceUnit/EJBProject 2026069911");
> >
> > EntityManager em= factory.createEntityManager();
> >
> >
> > Is there any better way how to get an EntityManager or an
> > EntityManagerFactory ?
>
> I'd recommend this technique over the direct lookup as the above code
> is guaranteed to break at some point.
>
> http://www.nabble.com/Re%3A-Obtaining-an-EntityManager-instance-outside-an-EJB-p21701466.html
>
>
> -David
>
>
> >
> > thanks for your suggest
> >
> >
> >
> >
> > Newgro wrote:
> >>
> >> Your problem is
> >>
> >> Connection refused: connect
> >>
> >> MySQL running? User Password correct? Do you use a firewall?
> >>
> >> Cheers
> >> Per
> >>
> >>
> >
> > --
> > View this message in context: http://www.nabble.com/Embedding-Openejb-tp22802864p22853879.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
> >
>
_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009
Re: Embedding Openejb
Posted by David Blevins <da...@visi.com>.
On Apr 2, 2009, at 11:08 AM, Berry25 wrote:
>
> I am sorry, i absolutelly forgot about it.
> I´d like to ask somebody. I use for to get EntityManagerFactory and
> EntityManager this piece of code
> ..
> context =
> SystemInstance
> .get().getComponent(ContainerSystem.class).getJNDIContext();
> ...
>
> factory = (EntityManagerFactory)
> context.lookup("/openejb/PersistenceUnit/EJBProject 2026069911");
>
> EntityManager em= factory.createEntityManager();
>
>
> Is there any better way how to get an EntityManager or an
> EntityManagerFactory ?
I'd recommend this technique over the direct lookup as the above code
is guaranteed to break at some point.
http://www.nabble.com/Re%3A-Obtaining-an-EntityManager-instance-outside-an-EJB-p21701466.html
-David
>
> thanks for your suggest
>
>
>
>
> Newgro wrote:
>>
>> Your problem is
>>
>> Connection refused: connect
>>
>> MySQL running? User Password correct? Do you use a firewall?
>>
>> Cheers
>> Per
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Embedding-Openejb-tp22802864p22853879.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>