populateModel & Autosaving

I am using the populateModel method to populate from a form. Then I am doing validation on the obj. However I am having an issue where data is being called objService.save(obj) every time I run populateModel().

Is there a way I can tell populateModel() not to save my ORM objects automatically?

I am using Railo 3.3.1 with Tomcat7 and Coldbox 3.5 Beta.


Jeremy R. DeYoung
Phone:615.261.8201

RantsFromAMadMan.com

Hmm populate should not save

turn flushAtRequestEnd to false in your application.cfc

Yeah,

Populate model shouldn’t be doing this.

My bet is that you’re either:

  1. Invoking something accidentally to save the object.

  2. You’re seeing some form of cached object that isn’t actually committed.

  3. Your orm session is being flushed on request end committing things to the database.

Rob

that was the problem. However, can someone explain when flushAtRequestEnd=true is a good idea!


Jeremy R. DeYoung
Phone:615.261.8201

RantsFromAMadMan.com

When you want to flush at the end of the request, of course!

boom boom :smiley:

Nope I can’t think of one, and to be honest I strongly believe it should never de set to true by default.

gotcha! Thanks!


Jeremy R. DeYoung
Phone:615.261.8201

RantsFromAMadMan.com