Details
Description
in a production system i'm getting:
org.exolab.castor.jdo.TransactionAbortedException: Nested error: org.exolab.castor.jdo.PersistenceException: Nested error: com.sap.dbtech.jdbc.exceptions.DatabaseException: [-5005] (at 118): Missing non-NULL value: [-5005] (at 118): Missing non-NULL value: Nested error: com.sap.dbtech.jdbc.exceptions.DatabaseException: [-5005] (at 118): Missing non-NULL value: [-5005] (at 118): Missing non-NULL value
at org.castor.persist.AbstractTransactionContext.prepare(AbstractTransactionContext.java:1198)
at org.exolab.castor.jdo.engine.LocalDatabaseImpl.commit(LocalDatabaseImpl.java:159)
at com.supridatta.bean.DataPersist.gravar(DataPersist.java:261)
but the object dont have a null value in that reference.
to better understand i will create a test case that contains follow classes:
Person() {
}
NaturalPerson() extends Person {
}
LegalPerson() extends Person {
}
Product() {
}
Motorcycle() extends Product {
Person holder;
Person reseller;
}
Invoice {
Person emitter;
Person billTo;
Vector<InvoiceItem> invoiceItem;
}
InvoiceItem {
Product product;
}
with this scenario in mind, the transaction that maybe throws that exception is:
1. Load all Motorcyle where holder is the reseller company.
2. Choose one of that Motorcycle.
3. In one transaction create an Invoice to sell this Motorcycle, and changes the holder to become the person that is on billTo of that Invoice.
at step 3 on commit we get the null pointer exception.
Attachments
Issue Links
| This issue is related to: | ||||
| CASTOR-2871 | In multi threaded environment we get DOAE: Type conversion error: could not set value of FieldMolder for field of type string with value of type java.lang.String |
|
|
|
| CASTOR-2865 | Improve solution to prevent reference set to null during long transaction. |
|
|
|
test case that simulates the problem, working for sapdb, ddl for other databases must be created.