?
Solved

V URGENT! Object updated in mapper but not in calling code!

Posted on 2004-04-29
5
Medium Priority
?
210 Views
Last Modified: 2010-04-24
I am having trouble with a bug that has popped up in our Object Mapper. If I pass in (to the mapper) an object to be destroyed, during the destruction process, the object is removed from any collections that form part of any bi-directional object relationship that the object is involved in. In the mapper this works fine, but the changes to the collection are not reflected outside of the mapper. Take the following scenario:

I have an object called objDeliveryCategory, which has a collection called allDeliveryBands, which contains 3 DeliveryBand objects. Each of these DeliveryBand objects also has an inverse relationship back to objDeliveryCategory, thus making a bi-directional 1..* relationship.  When I pass in one of the DeliveryBand objects to be destroyed: ObjectMapper.destroyObject(objDeliveryBand), the mapper removes objDeliveryBand from the allDeliveryBands collection that makes up part of the relationship and persists the changes to the collection. This all works fine and the correct rows are removed from the database. When I debug-step through the code in the mapper and use the command window to check the collection after the object has been removed and the collection persisted, I get the following:

?objPInverse.count
2 {Integer}
[Integer]: 2 {Integer}
?objPInverse.oid.ToString() 'Check the oid of the object to ensure it is the same collection
"e94c68fa-e0e9-4816-88af-05190dd74e00"

This is fine as the collection now has just 2 objects. However, once the ObjectMapper.destroyObject(objDeliveryBand) bit is completed, if I continue to step through the code of the subroutine that called the destroyObject function and check the collection that should now be minus one object, I get the following:

?Me.myDeliveryCategory.allDeliveryBands.Count()
3
?Me.myDeliveryCategory.allDeliveryBands.oid.ToString()
"e94c68fa-e0e9-4816-88af-05190dd74e00" 'The oid of the object is the same, so this is the same collection

And the object is still there. The database had been successfuly updated, the mapper seemed to be doing its job, but once out of the mapper, the object hasn't been removed. What is going on? The only thing that I can think of is that the offending collection is somehow being copied within the mapper. Could it be something else? And if not, how could this kind of behaviour happen?

This is an URGENT problem as it is holding up a project with an impending deadline. I've assigned 500 points, but am happy to add more. Any help is greatly appreciated.

Regards.

Stephen.
0
Comment
Question by:sroughley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11123178
Did you find a solution to this yourself?

Bob
0
 

Author Comment

by:sroughley
ID: 11124996
Ah. I completely forgot about asking this question. Yes, it was solved. It turned out that the interface was caching the objects in the Session StateBag, which removed them from the control of the DAL's IDMap/Cache.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11125735
Could you clean up this question then?

Thanks,
Bob "Cleanup Volunteer"
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 11196594
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question