Fwd: Session and transaction management

1 view
Skip to first unread message

Maxime Lévesque

unread,
Mar 23, 2011, 8:43:53 AM3/23/11
to squeryl-co...@googlegroups.com

I did a cosmetic change (put it in a sub section of the Wiki)
I agree with it, if I do end up disagreeing on something, it probably will be minor details...

---------- Forwarded message ----------
From: Matt Accola <mrac...@yahoo.com>
Date: Wed, Mar 23, 2011 at 2:04 PM
Subject: Re: Session and transaction management
To: Squeryl <squ...@googlegroups.com>


Ok, I added the Feature Proposal section...please edit as you see
fit.  If you have any other comments on the proposal please let me
know so I don't go down a path you dislike.

> >For backwards compatibility there would need to be a concept of a
> >"default" SessionFactory.  The "default" SessionFactory could be
> >initialized with the current SessionFactory.concreteFactory.
> >The current "transaction" logic would basically be short-hand for:
> ><code>
> >usingWithTransaction(SessionFactory.concreteFactory) { ... }
> ></code>
>
> Could this work with an implicit session defined ?

Yes

> >In order to make it completely clean there might be some cases where a
> >breaking change would be necessary.  For example, the "using(session)"
> >feature on queries isn't really compatible with this proposal.
>
> I don't see why it breaks compatibility...

Perhaps it doesn't but my thought was to change it so the programmer
who uses the DSL always passes references to the SessionFactory and
the framework takes care of creating a Session for the SessionFactory
if needed or using an existing current Session for that SessionFactory
if one already exists.  So I was thinking it would be changed to
"using(mySessionFactory)" instead of "using(mySession)".  At this time
I don't see why it would HAVE to change though.

On Mar 23, 6:39 am, Maxime Lévesque <maxime.leves...@gmail.com> wrote:
> I like the general idea, could you create a "feature proposal" section here
> :
>
>    http://www.assembla.com/wiki/show/byi9O8iyGr4j12eJe5cbCb<https://www.assembla.com/wiki/show/byi9O8iyGr4j12eJe5cbCb>
>
> and also  create a feature ticket for it.
>
> if/when it gets done it can be migrated to the doc.
>
> also :
>
> >For backwards compatibility there would need to be a concept of a
> >"default" SessionFactory.  The "default" SessionFactory could be
> >initialized with the current SessionFactory.concreteFactory.
> >The current "transaction" logic would basically be short-hand for:
> ><code>
> >usingWithTransaction(SessionFactory.concreteFactory) { ... }
> ></code>
>
> Could this work with an implicit session defined ?
>
> >In order to make it completely clean there might be some cases where a
> >breaking change would be necessary.  For example, the "using(session)"
> >feature on queries isn't really compatible with this proposal.
>
> I don't see why it breaks compatibility...

Reply all
Reply to author
Forward
0 new messages