Ticket Q489119
Visible to All Users

Session - Provide the capability to not mark a persistent object as modified for saving if only its non-persistent properties were changed

created 12 years ago

Hello, DevExpress Team!

I see that there is too much transaction in my project database. As I understood if I change a non-persistent property in my object than it will appear in ObjectToSave collection of session and will be commited in database when I call Commit Changes function.
I suggest to change this behavior. There is not need to save object again in database if only non-persistent properties were change.

Are you agree with me?
Thanks.

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

We have implemented the functionality described in this ticket. It will be included in our next update(s).

Please check back and leave a comment to this response to let us know whether or not this solution addresses your concerns.

Additional information:

Starting with version 13.1, you can use the following properties to control this behavior:

  1. XpoDefault.IsObjectModifiedOnNonPersistentPropertyChange
  2. Session.IsObjectModifiedOnNonPersistentPropertyChange
    created 12 years ago (modified 12 years ago)

    Hello Nicolae,
    While I agree that your suggestion makes sense for certain scenarios, it is already possible to accomplish your task.
    If you do not need your non-persistent properties to force a session to be modified, do not use the OnChanged or SetPropertyValue method in setters of your non-persistent properties.
    I hope this solution will meet your needs.

      Show previous comments (1)
      Dennis Garavsky (DevExpress) 12 years ago

        I am afraid this will break change notifications, unless you implement your own event in your persistent class and raise it from a non-persistent property setter.
        As for making changes at the XPO level, I have already verified with the XPO developers that it is not easily possible without introducing a breaking change, which may break the existing code of our XPO and XAF customers.

          May be you can introduce a parameter in Session class "to mark or not these objects as changed objects"? Or mark them but without generation of queries? Because I can't see any cause to make a query in database without changes in real persistent properties.

          Dennis Garavsky (DevExpress) 12 years ago

            Yes, we can, but we cannot promise any time frame for this implementation. I have converted your ticket to a feature request, and you will be automatically notified of any changes in this regard.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.