Details
Description
Currently, Database.getIdentity() returns null if the object has not been loaded in the same transaction.
Consider the following scenario:
- An object has been loaded from the database in a previous transaction
- The object hs been marshaled to XML and sent to a client app
- the client marks the object for removal and sends it back
- The server unmarshalls the object in a new transaction- this gives a new instance
- since remove() is also restricted to within transactions, i need to reload the original.
- the obvious way to do that is with the newly received object's identity
Activity
Ralf Joachim
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Ralf Joachim [ rjoachim ] |
Ralf Joachim
made changes -
| Attachment | patch-C1239-20051108.txt [ 17450 ] |
Ralf Joachim
made changes -
| Component/s | JDO [ 11331 ] | |
| Description |
Currently, Database.getIdentity() returns null if the object has not been loaded in the same transaction. Consider the following scenario: - An object has been loaded from the database in a previous transaction - The object hs been marshaled to XML and sent to a client app - the client marks the object for removal and sends it back - The server unmarshalls the object in a new transaction- this gives a new instance - since remove() is also restricted to within transactions, i need to reload the original. - the obvious way to do that is with the newly received object's identity |
Currently, Database.getIdentity() returns null if the object has not been loaded in the same transaction. Consider the following scenario: - An object has been loaded from the database in a previous transaction - The object hs been marshaled to XML and sent to a client app - the client marks the object for removal and sends it back - The server unmarshalls the object in a new transaction- this gives a new instance - since remove() is also restricted to within transactions, i need to reload the original. - the obvious way to do that is with the newly received object's identity |
| Environment | ||
| Fix Version/s | 0.9.9.1 [ 12055 ] |
Ralf Joachim
made changes -
| Status | Open [ 1 ] | In Progress [ 3 ] |
Ralf Joachim
made changes -
| Attachment | patch-C1239-20051110.txt [ 17502 ] |
Ralf Joachim
made changes -
| Status | In Progress [ 3 ] | Open [ 1 ] |
Ralf Joachim
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
Ralf Joachim
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Refactor org.exolab.castor.jdo.Utils to org.castor.jdo.util.JDOUtils and declare Utils as deprecated.
Add static closeDatabase() utility method.
Add static getIdentity() utility method.
The same code can be used to allow Database.getIdentity() to also return identity of objects that are not in the current transaction as this will be the more frequently usecase.