Can some explain to me what is the advantage of using detached objects within the context of a web application? AFAIK they are only useful if the objects somehow outlive the "lexical" scope of the transaction, but typically in a web app when your transaction is over you just send your objects to the view layer, and they will not be reattached.
To the best of my understanding, detaching an object is only useful if you are going to merge/reattach it later, and I am failing to see the advantage of this in relation to just simply doing a straight update of the object to the DB.
Any sample code is appreciated.
Edit: for clarification, I'm trying to understand the advantages of a detached object vs. a transient (one that came for the db for example but cannot be later reattached).