Current filter:
                                You should refresh the page.
                                Support Center
                                5
                                  • I have attached a solution that demonstrates that XPO objects CAN be serialized/deserialized. There is one problem:

                                    When objects are deserialized, they get associated to to the default session (this is great), but the state of objects in incorrect. The demo shows that an object can be created, saved, serialized, deserialized and still have its proper Oid and OptimisticLockId, yet the object when deserialized is placed in an inner collection that essentially marks the object as new regardless of having a proper Oid and OptimisticLockId.

                                    Proposed Solution:

                                    I am suggesting that a helper method be created that simply transfers objects from the inner collection (state) that makes XPO 'think' they are new to the collection that makes XPO consider them 'loaded' if they have a valid Oid (I.e. -1 for an integer should remain new).

                                    You can see from the Demo that developers attempting to use XPO in an N-Tier environent or anyone wanting the ability to serialize (store or transfer) XPO objects would love this feature.

                                    NOTE: The OptimisticLockId is PERFECT to ensure data integrity (assuming the objects are always used with the same database or a developer knows what they are doing). The OptimisticLockId can also be serialized/deserialized and ensures that remote changes would fail on update if the data (in the database) had changed since the data was pulled (serialized) up to the moment of update.

                                    Please, deeply consider this suggestion and also note that I would be very happy to be required to perform a cast to a base member to hide/protect this feature from abuse. Even an external helper would be great.

                                    I imagine having access to a method related to a session such as:

                                    session.ForceObjectsWithOIdsToLoadedState();

                                    Is this possible? Please? Please?

                                    Note without this feature, I am required to get the Oid of the object, fetch the latest copy (database version) of the object, manually check the OptimisticLockId, copy or transfer the properties to the newly loaded object and then perform a normal save>> where I have to still catch the possibility of a OptimisticLock failure. This makes coding ugly, majorly increases hits to the database, and significantly effects performance,let alone greatly increases the maintenance and complexity of designing objects and business logic.

                                    TIA

                                    Trevor

                                SerializationDemo.zip
                                0

                                Hi,
                                i have a problem similar to your.
                                Have you have made some update to your serialization demo ??
                                Thanks
                                Stefano

                                0

                                Hello Stefano,

                                We do not recommend serializing persistent objects and transferring them directly over the wire. Instead, please use a built-in XPO solution - Object Layer. Find more information on this at
                                http://documentation.devexpress.com/#XPO/CustomDocument10018
                                See also complete demo projects in the XpoTutorials demo: %Public%\Documents\DXperience 12.2 Demos\XPO\CS\XpoTutorials\ObjectLayerService\

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners