Project

General

Profile

Bug #11924

H2SequenceHandler.safeGetCurrentValue yields NPE

Added by Alexandru Lungu 14 days ago. Updated 14 days ago.

Status:
Review
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
production:
No
env_name:
topics:

History

#2 Updated by Alexandru Lungu 14 days ago

  • Assignee set to Alexandru Lungu

I attempted to run a large customer application with H2 database to regression test #8388. I got:

│  │  │                   at com.goldencode.p2j.util.int64.longValue(int64.java:762)
│  │  │                   at com.goldencode.p2j.persist.sequence.H2SequenceHandler.safeGetCurrentValue(H2SequenceHandler.java:188)
│  │  │                   at com.goldencode.p2j.persist.sequence.H2SequenceHandler.safeGetNextValue(H2SequenceHandler.java:240)
│  │  │                   at com.goldencode.p2j.persist.sequence.SequenceHandler.getNextValue(SequenceHandler.java:152)
│  │  │                   at com.goldencode.p2j.persist.SequenceManager.getValueImpl(SequenceManager.java:1791)
│  │  │                   at com.goldencode.p2j.persist.SequenceManager.nextValue(SequenceManager.java:353)

When retrieving the next-value of a sequence from H2.

#3 Updated by Alexandru Lungu 14 days ago

  • % Done changed from 0 to 100
  • Status changed from New to Review
  • reviewer Ovidiu Maxiniuc added

Fix is in 11924a/16775.

#4 Updated by Alexandru Lungu 14 days ago

PS: The original bug is the fact that the look-up by the sequence name was failing and yields NPE. Now it logs and returns an unknown value consistently. To fix the failed look-up, the sequence name should have been upper-cased before look-up, because FWD looks up for the curret sequence value in an H2 system table and the sequence name is provided as a positional parameter. By default, the WHERE seqName = ? is not case insensitive, so making it upper-case should do the trick. It is an apparent regression of HE RAA 20230110, that moved the sequence name as a positional parameter without making it upper first.

This unblocks unit testing of a large customer GUI application using a H2 back-end.

Also available in: Atom PDF