Hibernate service

David Leangen dleangen at canada.com
Sun Nov 7 03:26:26 EST 2004


Oh, this is great!

How about rather than sending me the code, you think about committing it to
the metro "playgound" or whatever it's to be called?



> -----Original Message-----
> From: Andreas Oberhack [mailto:develop at softwarefabrik.biz]
> Sent: 8 November 2004 16:23
> To: dleangen at canada.com; 'Support'
> Subject: RE: Hibernate service
>
>
> Hi David,
>
> I had a deep look into all the persistence stuff some time ago and have
> done the following:
>
> 1) build a customized merlin context component, which does the whole
> session instantiation stuff.
> 2) created a "hibernate independent" session and transaction interface.
> Those interfaces should be adaptable to JDO and OJB and other o/r tools
> too. I had a close look at TJDO, OJB and Castor to design those
> interfaces.
>
> The session is created at startup when the context component is loaded.
> Then every component can retrieve a / its persistent session through a
> custom context.
>
> One thing I was thinking about was to walk through all BLOCK-INF folders
> of the components and automatically retrieve the hbm files / jdo files,
> so that persistent classes would be automatically registered to the
> persistent service. But this is only possible for hibernate as far as I
> can see.
>
> This is all very initial stuff but working. I could send the code if you
> are interested.
>
> Andreas
>
> > -----Original Message-----
> > From: support-dpml-bounces at lists.ibiblio.org [mailto:support-dpml-
> > bounces at lists.ibiblio.org] On Behalf Of David Leangen
> > Sent: Sonntag, 7. November 2004 03:19
> > To: DPML Support
> > Subject: RE: Hibernate service
> >
> >
> > Peter,
> >
> > That's very interesting. I'll look more into Meercat. Thanks for the
> tip!
> >
> > > I have seen hibernate data objects as components extending from a
> > > class which provides a session, but personally don't like it.
> >
> > I agree! That's not my intention.
> >
> >
> > > I'm not quite sure what this means for 'a Hibernate Service'
> > > but there are a few thoughts to start with.
> >
> > Well, the major issue is to have a Startable component that can
> provide a
> > Hibernate session to other components. If done right, this could
> reduce
> > the
> > overhead in a major way. When I get to that point, I'll take a closer
> look
> > at the info you provided.
> >
> > Another thing I'm thinking about is how to change the @hibernate
> xdoclet
> > tags to @metro tags. This could be really interesting for further
> > "hibernizing" the metro system by using Magic for generating the O/R
> > mapping
> > file descriptors. If done right, these same tags could be used
> regardless
> > of
> > the underlying O/R mapping framework, so a user could potentially
> easily
> > switch out Hibernate for, say, Castor (using JDO). However, I don't
> have a
> > deep enough knowledge of the various O/R tools availalbe to know if
> this
> > is
> > really possible or not in practice.
> >
> >
> >
> > Cheers,
> > Dave
> >
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: Peter Courcoux [mailto:peter at courcoux.biz]
> > > Sent: 6 November 2004 5:25
> > > To: dleangen at canada.com; dpml support
> > > Subject: RE: Hibernate service
> > >
> > >
> > > I'm writing web-apps mainly and the way I do things is like this :-
> > >
> > > The hibernate session is created and managed through the mechanism
> of a
> > > servlet filter. This ensures the session is always closed, even if
> > > something goes awry. Generally, I use one of Ben Gidleys menagerie,
> a
> > > package called Meercat. See
> > > http://zebra.tigris.org/source/browse/zebra/src/java/meercat/ for
> this.
> > > This uses threadlocals to hold the session for the current thread,
> which
> > > works a treat for tomcat where all the processing of a single
> request
> > > takes place on a single thread (except where we create a new thread
> for
> > > something and have to be careful to deal with it correctly).
> > >
> > > I have seen hibernate data objects as components extending from a
> class
> > > which provides a session, but personally don't like it.
> > >
> > > I prefer to keep the hibernate object as clean and simple as
> possible
> > > and then write managers for each. There are various issues with the
> way
> > > hibernate uses objects and keeping them simple seems to pay
> dividends.
> > > (Simply adding a logging line into a collection setter can result in
> a
> > > hard to track down exception coming from within hibernate itself)
> > >
> > > The managers are written as components and are the only place in the
> > > application where I allow a session. Reporting queries are also in
> the
> > > manager package. The hibernate session is obtained from Meercat.
> > >
> > > I'm not quite sure what this means for 'a Hibernate Service' but
> there
> > > are a few thoughts to start with.
> > >
> > >
> > > On Fri, 2004-11-05 at 18:29, David Leangen wrote:
> > > > Hi, Peter!
> > > >
> > > > > David, what kind of apps are you writing? web, thick client,
> etc.
> > > >
> > > >
> > > > Actually, all of the above.
> > > >
> > > > I have, for example :
> > > >
> > > >  - a DB maintenance app
> > > >  - a thick client
> > > >  - (soon) a web app
> > > >
> > > >
> > > > Regards,
> > > > Dave
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > support-dpml mailing list
> > > > support-dpml at lists.ibiblio.org
> > > > http://lists.ibiblio.org/mailman/listinfo/support-dpml
> > > --
> > > Regards,
> > >
> > > Peter
> > > ----------------------------
> > > Peter Courcoux
> > > Telephone +44 (0)1923 661488
> > > Mobile 07880 605626
> > > ----------------------------
> >
> > _______________________________________________
> > support-dpml mailing list
> > support-dpml at lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/support-dpml
> >
> > ---
> > Incoming mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.788 / Virus Database: 533 - Release Date: 01.11.2004
> >
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.788 / Virus Database: 533 - Release Date: 01.11.2004
>




More information about the support-dpml mailing list