Re: Making detaching the default behaviour
Anthony & Melissa Berglas <[email protected]>
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <[email protected]> |
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>[email protected] > > > > +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>[email protected] > > EMail: [email protected] +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? Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/SimpleORM/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/SimpleORM/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/