Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

persistence and transactions: One-to-many consistency problem

Former Member
0 Kudos

Hi,

we have the following problem: We have two persistent classes A and B that are connected via a one-to-many (1:n) relationship. Now we

1. get an object "a" of class A and a number of related objects of class B from the persistence manager. Then we

3. delete the relationship between "a" and one object of class B. Then (without commit)

4. the GUI requests to show all related Bs for our given "a" and:

5. the query returns also the "deleted" object.

All these steps are performed within the same (object oriented) top level transaction.

The reason for this seems clear to us: The removal of the B has not been persisted in the DB. However, we don't really know how to deal with it...

Any suggestion is welcome.

Christoph

2 REPLIES 2

GrahamRobbo
Active Contributor
0 Kudos

Hi Chris,

it is unclear to me if you are re-reading the database after you delete the 'b' item.

Anyway, the way persistent objects work is that changes are not written to the database until the SAP LUW ends with a COMMIT WORK.

Cheers

Graham Robbo

0 Kudos

Yeah, you are perfectly right. We DID re-read from the database. However, we assumed that changes within the same transaction would be visible for the application. But they are not. Thanks.

Christoph