The recommendation against storing Transfer objects in a session applies
only to persisted objects. That's because persisted objects are cached by
Transfer, and keeping a reference to a persisted object in a scope like
session can interfere with Transfer's cache management.

For example, Transfer can expire an object from its cache while the object
is still in your session scope. If another request then calls Transfer.get()
on the object's ID, Transfer will create another instance of the same
object. Modifying either instance at this point can create conflicting
object states. I don't know enough about Transfer's internals to know how it
would handle this, but I'm sure it's not going to be pretty or painless.

The recommendation for persisted Transfer objects is to store IDs in the
session and call Transfer.get() as needed on each request, so that you
always get the object from Transfer's cache if one is there.

If you create a new Registrant object with Transfer.new() on step 1
submission but don't call Transfer.save() on it until step 3 submission,
then the object won't be persisted until the end of step 3 so it's safe to
keep the registrant object in the session scope until then. However you may
want to delete the objects from the session scope after the save.

-- Dennis

On Tue, Aug 24, 2010 at 9:49 AM, Jason Durham <jqdur...@gmail.com> wrote:

> I am building a multipart form but am struggling with how to do this with
> Transfer.  For the sake of discussion, lets say the form is for a car show.
> One Registrant can bring multiple Cars (Registrant -> O2M -> Car).  The form
> has 3 basic steps.  The first part simply models a Registrant (person) with
> contact information.  Registrant properties are validated on submit
> (server-side) and the user is not permitted to step 2 until they enter
> correct data.  The second step allows the user to enter in Cars one at a
> time.  Each car is submitted, validated and the result is sent back to user
> on step 2.  Once they are finished adding Cars, they click a button to
> continue to step 3. Step 3 is just confirmation and payment (link to
> PayPal).
>
> The issue I can't get my head around is persisting the Registrant Transfer
> object.  I've read it's not recommended to store Transfer objects in a
> session, so I'm not sure how to make this object persist between requests
> without passing it to the client.  Of course, the Registrant won't be saved
> until after step 3.
>
> Jason
>
>

-- 
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

Try out the new Transfer ORM Custom Google Search:
http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to transfer-dev@googlegroups.com
To unsubscribe from this group, send email to 
transfer-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en

Reply via email to