Still not in bed .. was too curious about that session thing.

Adding this parameter indeed works - I get some kind of session object
in the contribute method. But what session is this? Is it a session
which is created at this moment (and is already closed when I really
need it) or is it some kind of proxy which always points to the
session which is active in the moment I need it?

Marcus.

2007/9/10, Marcus Schmidke <[EMAIL PROTECTED]>:
> Ok ...,
>
> I took a shower which made things much much clearer.
>
> I think I should build and register a BusinessService (just like a
> stateless session bean) which encapsulates the Hibernate things. This
> Service can have the Hibernate Session injected on some different ways
> (just like explained in the document you mentioned), and my value
> encoder can make use of this service (I tried to add the service as
> parameter to the contributeValueEncoderSource method, and damn! it
> worked).
>
> Great, all this seems to work now. Was not too complicated, perhaps
> only too late for me. Time to go to bed.
>
> Have a good night!
>
> Marcus.
>
> PS. I'm just thinking about what had happened if I had added a
> Hibernate Session parameter to contributeValueEncoderSource's
> parameter list? Perhaps this would have worked either?
>
>
> 2007/9/10, Marcus Schmidke <[EMAIL PROTECTED]>:
> > Yes ... I've read ... parts of it more than once ... but
> > unfortunately, I do not seem to be clever enough.
> >
> > I want to write a value encoder which maps Hibernate Entities to their
> > IDs and vice versa.
> >
> > I've written
> > - a HibernateValueEncoder
> > - a HibernateValueEncoderFactory
> > - an AppModule containing the following:
> >
> > public static void
> > contributeValueEncoderSource(MappedConfiguration<Class<?>,
> > ValueEncoderFactory<ObjektMitSeqID>> configuration) {
> >                 configuration.add(ObjektMitSeqID.class, new 
> > HibernateValueEncoderFactory());
> > }
> >
> > (where ObjektMitSeqID is the base class of all of my Hibernate Entities).
> >
> > This all works fine, no problem, but only as long as I use my own
> > HibernateUtil to create a Session. But I would prefer using tapestry
> > to create the Hibernate Session.
> >
> > Since I don't create a service on my own, but only contribute
> > configuration to an existing service, I have absolutely no plan how or
> > where to inject the Hibernate Session.
> >
> > Perhaps I'm a little bit confused. I don't know. Do you have another hint?
> >
> >
> > Marcus.
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to