You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Diego <di...@gmail.com> on 2005/03/30 12:14:57 UTC

Using Hivemind with cayenne datacontext

Hello,

I am using Hivemind to get a cayenne datacontext from a service
(CayenneService) in a tapestry application. The service is based on
the example of getting a cayenne datacontext from the wiki. This works
fine when using the service only to retrieve the datacontext, but now
i want to inject this service into other services. But the example
from the wiki is a Singleton Service Model.

What I want is that datacontext is dependend on a session. So the when
injecting the CayenneService in an other service for a certain session
the same datacontext is used.

Should I use a Threaded Service Model or a Pooled Service Model to realize this?

Regards,

Diego

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Using Hivemind with cayenne datacontext

Posted by Diego <di...@gmail.com>.
Hello James,

It would help me a lot of you could send it to me.

Regards
Diego


On Thu, 31 Mar 2005 06:43:27 -0500, James Carman
<ja...@carmanconsulting.com> wrote:
> Diego,
> 
> I have an article coming out soon on HiveMind at TheServerSide.com and with
> it you'll be able to download an example project that uses Hibernate with
> the threaded service lifecycle model.  Would it help you if I emailed that
> to you so that you had an example?  It's not that big, as it downloads all
> of the jars that it needs from Ibiblio.  I am going to ask the other
> committers if they think it should be included as one of the example
> applications with the HiveMind download.  There may be licensing issues.  I
> don't know.
> 
> James
> 
> -----Original Message-----
> From: Diego [mailto:diego.foo@gmail.com]
> Sent: Thursday, March 31, 2005 4:01 AM
> To: hivemind-user@jakarta.apache.org
> Subject: Re: Using Hivemind with cayenne datacontext
> 
> Thanks, I tried the threaded model, but it didn't work for me. The
> CayenneService was call from different threads in tapestry. So I think I
> will store the DataContext in the visit when its created and pass it to the
> service that need it.
> 
> Regards
> Diego
> 
> On Wed, 30 Mar 2005 13:43:41 -0300, Marcus Brito <mb...@gmail.com> wrote:
> > On Wed, 30 Mar 2005 12:14:57 +0200, Diego <di...@gmail.com> wrote:
> > > Should I use a Threaded Service Model or a Pooled Service Model to
> > > realize this?
> >
> > I'm not familiar with Cayenne, but ff Cayenne DataContexts are
> > anything like Hibernate Sessions, yes, a threaded service model is
> > what you want. This will create and bind a new object the first time
> > it's asked for, and will return the same object in subsequents lookups
> > within the same thread.
> >
> > -- Marcus Brito
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Using Hivemind with cayenne datacontext

Posted by Marcus Brito <mb...@gmail.com>.
James, could you please CC me while sending that example project? ;-)

-- Marcus Brito <mb...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: Using Hivemind with cayenne datacontext

Posted by James Carman <ja...@carmanconsulting.com>.
Diego,

I have an article coming out soon on HiveMind at TheServerSide.com and with
it you'll be able to download an example project that uses Hibernate with
the threaded service lifecycle model.  Would it help you if I emailed that
to you so that you had an example?  It's not that big, as it downloads all
of the jars that it needs from Ibiblio.  I am going to ask the other
committers if they think it should be included as one of the example
applications with the HiveMind download.  There may be licensing issues.  I
don't know.

James

-----Original Message-----
From: Diego [mailto:diego.foo@gmail.com] 
Sent: Thursday, March 31, 2005 4:01 AM
To: hivemind-user@jakarta.apache.org
Subject: Re: Using Hivemind with cayenne datacontext


Thanks, I tried the threaded model, but it didn't work for me. The
CayenneService was call from different threads in tapestry. So I think I
will store the DataContext in the visit when its created and pass it to the
service that need it.

Regards
Diego 


On Wed, 30 Mar 2005 13:43:41 -0300, Marcus Brito <mb...@gmail.com> wrote:
> On Wed, 30 Mar 2005 12:14:57 +0200, Diego <di...@gmail.com> wrote:
> > Should I use a Threaded Service Model or a Pooled Service Model to 
> > realize this?
> 
> I'm not familiar with Cayenne, but ff Cayenne DataContexts are 
> anything like Hibernate Sessions, yes, a threaded service model is 
> what you want. This will create and bind a new object the first time 
> it's asked for, and will return the same object in subsequents lookups 
> within the same thread.
> 
> -- Marcus Brito
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Using Hivemind with cayenne datacontext

Posted by Diego <di...@gmail.com>.
Thanks, I tried the threaded model, but it didn't work for me. The
CayenneService was call from different threads in tapestry. So I think
I will store the DataContext in the visit when its created and pass it
to the service that need it.

Regards
Diego 


On Wed, 30 Mar 2005 13:43:41 -0300, Marcus Brito <mb...@gmail.com> wrote:
> On Wed, 30 Mar 2005 12:14:57 +0200, Diego <di...@gmail.com> wrote:
> > Should I use a Threaded Service Model or a Pooled Service Model to realize this?
> 
> I'm not familiar with Cayenne, but ff Cayenne DataContexts are
> anything like Hibernate Sessions, yes, a threaded service model is
> what you want. This will create and bind a new object the first time
> it's asked for, and will return the same object in subsequents lookups
> within the same thread.
> 
> -- Marcus Brito
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Using Hivemind with cayenne datacontext

Posted by Marcus Brito <mb...@gmail.com>.
On Wed, 30 Mar 2005 12:14:57 +0200, Diego <di...@gmail.com> wrote:
> Should I use a Threaded Service Model or a Pooled Service Model to realize this?

I'm not familiar with Cayenne, but ff Cayenne DataContexts are
anything like Hibernate Sessions, yes, a threaded service model is
what you want. This will create and bind a new object the first time
it's asked for, and will return the same object in subsequents lookups
within the same thread.

-- Marcus Brito

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org