openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Benett <>
Subject Possible bug for OpenJPA
Date Tue, 16 Apr 2019 19:37:02 GMT

We use OpenJPA in our project and had noticed some strange behavior a while ago when child
entity classes are not loaded into parent class entity.

Db setup: table called item with 2 primary keys (id and sales device id), table called promotion
with 2 primary keys (id and sales device id)
Java setup: is configured with annotation @Inheritance(strategy=InheritanceType.JOINED)
and which extends Item and has no id fields.
The class Item is in the TransactionItem class and TransactionItem belongs to Transaction.
We have configured all entities as EAGER LOADING, however what we noticed that when transaction
is closed and sent to print a receipt,
“item instanseof Promotion” is sometimes false. Both item and promotion records do exist
in db.
Interesting thing is that “item instanseof Promotion” had worked fine for many years and
only lately began to fail, however code in this area was not changed for a long time.
Another problem is that we could never reproduce this issue in our env but it consistently
happens in prod.
Is that possible that some entities in the transaction are not fully loaded or in process
of loading while transaction is closed and parsed to generate a receipt?
Recently we had to implement an additional procedure to explicitly load an item from db into
each trans item directly, but “item instanseof Promotion” is still sometimes false. This
issue is particularly crucial for us because transaction total is not calculated correctly
on a receipt as promotion item is not identified as promotion.

It seems like maybe we reach some limit for loaded entities, however it’s not really clear
what to look for
Only one thing I could say is over last couple of years more and more tables were added to
the db and some of them are a part of the transaction


Alexander Benett
Senior Java Developer - CarWash Controls
Tel: (954) 720-4102
5605 Hiatus Road, Tamarac, FL, 33321
 [] <>
  [] <'s-enterprises>
  [] <>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message