Search the web
Sign In
New User? Sign Up
SimpleORM
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Making detaching the default behaviour   Message List  
Reply | Forward Message #1543 of 1851 |
Re: [SimpleORM] Making detaching the default behaviour

Ok, so I went on and added a SConnection.detachDataSet() static method
to SConnection.

Beware, SConnection.commit(), SConnection.detachAndClose(), ... still
destroy the records, so detachDataSet() must be called before if you
wanted it to have anything to detach...

This is in 'franck' branch of svn.

Franck

Le lundi 04 février 2008 à 21:04 +1000, Anthony & Melissa Berglas a
écrit :
> I like your idea of a detach all records
> method. It also avoids the issues of partial
> detachment, where children are detached but not parents.
>
> Anthony
>
> At 07:46 PM 04-02-08, Franck Routier wrote:
>
> >Hi Anthony,
> >
> >in my app, I tend to always detach records, to display and update
> them
> >in the presentation layer. I also detach them to handle business
> rules
> >in the business layer. Cases where I read / udpate / commit from
> within
> >a single Simpleorm transaction are ... well, I don't have such case
> >until now :) And I have been beaten by the destroy behaviour in
> methods
> >that were only querying data, where I would detach the main record,
> but
> >not the one implicitely attached to the transaction because they were
> >references.
> >
> >But I understand your argument. Maybe I could add a method to
> >SConnection to detach all records, leaving the default behaviour to
> >destroying, but giving one stop choice for those of the detaching
> kind
> >like me.
> >
> >Don't know if somebody else has an opinion on the subject ?
> >
> >Franck
> >
> >Le dimanche 03 février 2008 à 19:50 +1000, Anthony & Melissa Berglas
> a
> >écrit :
> > > Simply that accessing records after a commit is probably a
> > > bug. Updates to the records will not be reflected in the
> > > database. So the symptoms could be obscure and nasty. I do prefer
> > > the explicit detach.
> > >
> > > Anthony
> > >
> > > At 08:27 PM 29-01-08, Franck Routier wrote:
> > >
> > > >Hi,
> > > >
> > > >I am considering making detaching the records from the connection
> the
> > > >default behaviour, instead of destroying them, when
> > > committing/closing
> > > >the connection.
> > > >
> > > >But I am eager to understand why destroying the records was the
> > > default
> > > >behaviour in the first place... Any enlightenmnet on this ?
> > > >
> > > >Thanks,
> > > >Franck
> > > >
> > > >
> > >
> > > EMail:
> > <mailto:berglas%
> 40spreadsheetdetective.com>berglas@...
> > >
> > > +61 7 3369 4065 (Australian Eastern Standard Time)
> > >
> > > If the model seems correct only because the numbers look right,
> > > then why build the model in the first place?
> > >
> > >
> > >
> > >
> >--
> >Franck Routier
> >Axège Sarl - 23, rue Saint-Simon, 63000 Clermont-Ferrand (FR)
> >Tél : +33 463 059 540
> >mèl : <mailto:franck.routier%40axege.com>franck.routier@...
> >
> >
>
> EMail: berglas@...
>
> +61 7 3369 4065 (Australian Eastern Standard Time)
>
> If the model seems correct only because the numbers look right,
> then why build the model in the first place?
>
>
>
>
>
--
Franck Routier
Axège Sarl - 23, rue Saint-Simon, 63000 Clermont-Ferrand (FR)
Tél : +33 463 059 540
mèl : franck.routier@...





Tue Feb 5, 2008 10:51 am

routier_franck
Offline Offline
Send Email Send Email

Forward
Message #1543 of 1851 |
Expand Messages Author Sort by Date

Hi, I am considering making detaching the records from the connection the default behaviour, instead of destroying them, when committing/closing the...
Franck Routier
routier_franck
Offline Send Email
Jan 29, 2008
10:27 am

Simply that accessing records after a commit is probably a bug. Updates to the records will not be reflected in the database. So the symptoms could be...
Anthony & Melissa Ber...
berglas@...
Send Email
Feb 3, 2008
9:49 am

Hi Anthony, in my app, I tend to always detach records, to display and update them in the presentation layer. I also detach them to handle business rules in...
Franck Routier
routier_franck
Offline Send Email
Feb 4, 2008
9:46 am

I like your idea of a detach all records method. It also avoids the issues of partial detachment, where children are detached but not parents. Anthony ... ...
Anthony & Melissa Ber...
berglas@...
Send Email
Feb 4, 2008
11:03 am

Ok, so I went on and added a SConnection.detachDataSet() static method to SConnection. Beware, SConnection.commit(), SConnection.detachAndClose(), ... still ...
Franck Routier
routier_franck
Offline Send Email
Feb 5, 2008
10:51 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help