The weirdness continues! I put logging.level.eclipselink.logging.sql = debug
into application.properties
to see if for some reason this particular screen was just ALWAYS re-loading the instance from the DB, and I found that indeed it is.
BUT KEEP IN MIND THIS IS ONLY HAPPENING WHEN RUNNING FROM INSIDE INTELLIJ! It works as expected when deployed to a container. (It also doesn’t work correctly if I generate a .jar and run java -jar jar.file
.)
Here is the logs from clicking “Edit” on a WORKING Table → Editor pair on the same screen. Before changing the instance, it will always load it from the DB, but once it’s changed, it does not:
(The “[P] Screen” and similar log lines are just log.info()
calls I’ve put in to mark. P screen is the parent, patient screen, A screen is the child, Address screen. This is the pair that works correctly.)
First time, before the instance is changed:
2023-10-05 08:47:10.054 INFO 2287205 --- [nio-8080-exec-7] c.m.m.web.screens.patient.PatientEdit : [P Screen] Zip = [47960], instance = [com.medflex.medflexj.entity.patient.PatientAddress-5cfbdf54-750d-d62b-7ea4-08bc9010090e [detached]], version = [1]
2023-10-05 08:47:10.077 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 1938591947> SELECT ID, ADDRESS_LINE1, ADDRESS_LINE2, CITY, CREATE_TS, CREATED_BY, DELETE_TS, DELETED_BY, STATE, UPDATE_TS, UPDATED_BY, VERSION, ZIP, PATIENT_ID FROM MEDFLEXJ_PATIENT_ADDRESS WHERE ((ID = ?) AND (DELETE_TS IS NULL))
bind => [5cfbdf54-750d-d62b-7ea4-08bc9010090e]
2023-10-05 08:47:10.078 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 1938591947> [1 ms] spent
2023-10-05 08:47:10.078 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 427125818> SELECT ID, DELETE_TS, DELETED_BY, FIRST_NAME, LAST_NAME, VERSION, GENDER_ID, LANGUAGE_ID, MARITAL_STATUS_ID, ALTERNATE_ADDRESS_ID, CURRENT_ADDRESS_ID, FORMER_ADDRESS_ID FROM MEDFLEXJ_PATIENT WHERE ((ID = ?) AND (0=0))
bind => [61fc3e9b-8911-d491-838d-8c088c1836ec]
2023-10-05 08:47:10.078 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 427125818> [0 ms] spent
2023-10-05 08:47:10.081 INFO 2287205 --- [nio-8080-exec-7] c.m.m.w.s.p.PatientAddressEdit : [A Screen] Zip = [47960], instance = [com.medflex.medflexj.entity.patient.PatientAddress-5cfbdf54-750d-d62b-7ea4-08bc9010090e [detached]], version = [1]
Once the instance is changed:
2023-10-05 08:49:01.460 INFO 2287205 --- [nio-8080-exec-7] c.m.m.web.screens.patient.PatientEdit : [P Screen] Zip = [47960-1234], instance = [com.medflex.medflexj.entity.patient.PatientAddress-5cfbdf54-750d-d62b-7ea4-08bc9010090e [detached]], version = [1]
2023-10-05 08:49:01.500 INFO 2287205 --- [nio-8080-exec-7] c.m.m.w.s.p.PatientAddressEdit : [A Screen] Zip = [47960-1234], instance = [com.medflex.medflexj.entity.patient.PatientAddress-5cfbdf54-750d-d62b-7ea4-08bc9010090e [detached]], version = [1]
Note that once the Address instance is changed, the editor screen isn’t triggering any SQL to reload the instance, and the proper, changed instance is used and edited.
Now the non-working Table → Editor pair. Note these are on the SAME screen.
First time, before the instance (in this case a Note) is changed:
2023-10-05 08:50:40.184 INFO 2287205 --- [nio-8080-exec-9] c.m.m.web.screens.patient.PatientEdit : [P Screen] Text = [qaz], instance = [com.medflex.medflexj.entity.PatientNotes-139afd20-fef4-5713-061d-85282acba0fb [detached]], version = [4]
2023-10-05 08:50:40.200 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 680893444> SELECT ID, COMPLETED, COMPLETED_INITIALS_LEGACY, COMPLETED_ON, CREATE_TS, CREATED_BY, CRITICAL_FOR_BILLING, CRITICAL_FOR_PURCHASING, DATE_, DELETE_TS, DELETED_BY, DUE_DATE, LEGACY_RECNUM, STEP_ORDER, TEXT, UPDATE_TS, UPDATED_BY, VERSION, INVOICE_ID, NOTE_TYPE_ID, PATIENT_ID FROM MEDFLEXJ_PATIENT_NOTES WHERE ((ID = ?) AND (DELETE_TS IS NULL))
bind => [139afd20-fef4-5713-061d-85282acba0fb]
2023-10-05 08:50:40.201 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 680893444> [1 ms] spent
2023-10-05 08:50:40.201 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 1208661778> SELECT ID, DELETE_TS, DELETED_BY, FIRST_NAME, LAST_NAME, VERSION, GENDER_ID, LANGUAGE_ID, MARITAL_STATUS_ID, ALTERNATE_ADDRESS_ID, CURRENT_ADDRESS_ID, FORMER_ADDRESS_ID FROM MEDFLEXJ_PATIENT WHERE ((ID = ?) AND (0=0))
bind => [61fc3e9b-8911-d491-838d-8c088c1836ec]
2023-10-05 08:50:40.201 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 1208661778> [0 ms] spent
2023-10-05 08:50:40.201 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 825448164> SELECT ID, DELETE_TS, DELETED_BY, NUMBER_, PHASE, RESPONSIBILITY, VERSION, DEVICE_TYPE_ID, GUARANTOR_ID, LOCATION_ID, PATIENT_ID, PRACTITIONER_ID, REGISTRATION_ID, RESPONSIBLE_INSURANCE_ID, SERVICE_SITE_ID, RECEIVABLE_LEDGER_TRANSACTION_ID FROM MEDFLEXJ_INVOICE WHERE ((PATIENT_ID = ?) AND (DELETE_TS IS NULL)) ORDER BY NUMBER_ ASC
bind => [61fc3e9b-8911-d491-838d-8c088c1836ec]
2023-10-05 08:50:40.202 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 825448164> [1 ms] spent
2023-10-05 08:50:40.202 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 1968304791> SELECT ID, DELETE_TS, DELETED_BY, SEQUENCE, VERSION, CARRIER_ID, POLICY_HOLDER_ID, REGISTRATION_ID FROM MEDFLEXJ_REGISTRATION_INSURANCE WHERE ((ID = ?) AND (0=0))
bind => [e28778de-0bff-060b-5a00-47dac31269ac]
2023-10-05 08:50:40.202 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 1968304791> [0 ms] spent
2023-10-05 08:50:40.202 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 1799253364> SELECT ID, DELETE_TS, DELETED_BY, NAME, VERSION, BILLING_FORM_ID, CARRIER_FAMILY_ID, CARRIER_FOR_ALLOWABLES_ID, CARRIER_FOR_PRICE_ID, CONTRACT_ID, LOCATION_FOR_ELECTRONIC_BILLING_ID, ELECTRONIC_PROCESSOR_ID, PAY_SOURCE_ID, PRICE_LEVEL_ID FROM MEDFLEXJ_CARRIER WHERE ((ID = ?) AND (0=0))
bind => [7f88207e-ae8b-2f60-4dc9-c279c68bfed2]
2023-10-05 08:50:40.203 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 1799253364> [1 ms] spent
2023-10-05 08:50:40.203 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 123935186> SELECT ID, DELETE_TS, DELETED_BY, DESCRIPTION, VERSION FROM MEDFLEXJ_NOTE_TYPE WHERE ((ID = ?) AND (0=0))
bind => [76bf84bd-2f4b-bd06-5905-9d68571eae28]
2023-10-05 08:50:40.203 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 123935186> [0 ms] spent
2023-10-05 08:50:40.203 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 839034080> SELECT ID, DELETE_TS, DELETED_BY, VERSION, PATIENT_NOTE_ID, DOCUMENT_ID FROM MEDFLEXJ_PATIENT_NOTE_DOCUMENT WHERE ((PATIENT_NOTE_ID = ?) AND (DELETE_TS IS NULL))
bind => [139afd20-fef4-5713-061d-85282acba0fb]
2023-10-05 08:50:40.203 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 839034080> [0 ms] spent
2023-10-05 08:50:40.215 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 1863700925> SELECT ID, DELETE_TS, DELETED_BY, DESCRIPTION, VERSION FROM MEDFLEXJ_NOTE_TYPE WHERE (DELETE_TS IS NULL)
2023-10-05 08:50:40.215 DEBUG 2287205 --- [nio-8080-exec-9] eclipselink.logging.sql : <t 294561575, conn 1863700925> [0 ms] spent
2023-10-05 08:50:40.231 INFO 2287205 --- [nio-8080-exec-9] c.m.m.w.s.patientnotes.PatientNotesEdit : [N Screen] Text = [qaz], instance = [com.medflex.medflexj.entity.PatientNotes-139afd20-fef4-5713-061d-85282acba0fb [detached]], version = [4]
After the note instance is changed:
2023-10-05 08:52:02.097 INFO 2287205 --- [nio-8080-exec-7] c.m.m.web.screens.patient.PatientEdit : [P Screen] Text = [qazwsx], instance = [com.medflex.medflexj.entity.PatientNotes-139afd20-fef4-5713-061d-85282acba0fb [detached]], version = [4]
2023-10-05 08:52:02.115 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 552085039> SELECT ID, COMPLETED, COMPLETED_INITIALS_LEGACY, COMPLETED_ON, CREATE_TS, CREATED_BY, CRITICAL_FOR_BILLING, CRITICAL_FOR_PURCHASING, DATE_, DELETE_TS, DELETED_BY, DUE_DATE, LEGACY_RECNUM, STEP_ORDER, TEXT, UPDATE_TS, UPDATED_BY, VERSION, INVOICE_ID, NOTE_TYPE_ID, PATIENT_ID FROM MEDFLEXJ_PATIENT_NOTES WHERE ((ID = ?) AND (DELETE_TS IS NULL))
bind => [139afd20-fef4-5713-061d-85282acba0fb]
2023-10-05 08:52:02.116 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 552085039> [1 ms] spent
2023-10-05 08:52:02.116 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 2033159761> SELECT ID, DELETE_TS, DELETED_BY, FIRST_NAME, LAST_NAME, VERSION, GENDER_ID, LANGUAGE_ID, MARITAL_STATUS_ID, ALTERNATE_ADDRESS_ID, CURRENT_ADDRESS_ID, FORMER_ADDRESS_ID FROM MEDFLEXJ_PATIENT WHERE ((ID = ?) AND (0=0))
bind => [61fc3e9b-8911-d491-838d-8c088c1836ec]
2023-10-05 08:52:02.116 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 2033159761> [0 ms] spent
2023-10-05 08:52:02.116 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 558463881> SELECT ID, DELETE_TS, DELETED_BY, NUMBER_, PHASE, RESPONSIBILITY, VERSION, DEVICE_TYPE_ID, GUARANTOR_ID, LOCATION_ID, PATIENT_ID, PRACTITIONER_ID, REGISTRATION_ID, RESPONSIBLE_INSURANCE_ID, SERVICE_SITE_ID, RECEIVABLE_LEDGER_TRANSACTION_ID FROM MEDFLEXJ_INVOICE WHERE ((PATIENT_ID = ?) AND (DELETE_TS IS NULL)) ORDER BY NUMBER_ ASC
bind => [61fc3e9b-8911-d491-838d-8c088c1836ec]
2023-10-05 08:52:02.116 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 558463881> [0 ms] spent
2023-10-05 08:52:02.117 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 163764665> SELECT ID, DELETE_TS, DELETED_BY, SEQUENCE, VERSION, CARRIER_ID, POLICY_HOLDER_ID, REGISTRATION_ID FROM MEDFLEXJ_REGISTRATION_INSURANCE WHERE ((ID = ?) AND (0=0))
bind => [e28778de-0bff-060b-5a00-47dac31269ac]
2023-10-05 08:52:02.117 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 163764665> [0 ms] spent
2023-10-05 08:52:02.117 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 947395487> SELECT ID, DELETE_TS, DELETED_BY, NAME, VERSION, BILLING_FORM_ID, CARRIER_FAMILY_ID, CARRIER_FOR_ALLOWABLES_ID, CARRIER_FOR_PRICE_ID, CONTRACT_ID, LOCATION_FOR_ELECTRONIC_BILLING_ID, ELECTRONIC_PROCESSOR_ID, PAY_SOURCE_ID, PRICE_LEVEL_ID FROM MEDFLEXJ_CARRIER WHERE ((ID = ?) AND (0=0))
bind => [7f88207e-ae8b-2f60-4dc9-c279c68bfed2]
2023-10-05 08:52:02.117 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 947395487> [0 ms] spent
2023-10-05 08:52:02.117 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 943732159> SELECT ID, DELETE_TS, DELETED_BY, DESCRIPTION, VERSION FROM MEDFLEXJ_NOTE_TYPE WHERE ((ID = ?) AND (0=0))
bind => [76bf84bd-2f4b-bd06-5905-9d68571eae28]
2023-10-05 08:52:02.117 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 943732159> [0 ms] spent
2023-10-05 08:52:02.117 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 1512455888> SELECT ID, DELETE_TS, DELETED_BY, VERSION, PATIENT_NOTE_ID, DOCUMENT_ID FROM MEDFLEXJ_PATIENT_NOTE_DOCUMENT WHERE ((PATIENT_NOTE_ID = ?) AND (DELETE_TS IS NULL))
bind => [139afd20-fef4-5713-061d-85282acba0fb]
2023-10-05 08:52:02.118 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 1512455888> [1 ms] spent
2023-10-05 08:52:02.124 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 102750355> SELECT ID, DELETE_TS, DELETED_BY, DESCRIPTION, VERSION FROM MEDFLEXJ_NOTE_TYPE WHERE (DELETE_TS IS NULL)
2023-10-05 08:52:02.124 DEBUG 2287205 --- [nio-8080-exec-7] eclipselink.logging.sql : <t 615477609, conn 102750355> [0 ms] spent
2023-10-05 08:52:02.132 INFO 2287205 --- [nio-8080-exec-7] c.m.m.w.s.patientnotes.PatientNotesEdit : [N Screen] Text = [qaz], instance = [com.medflex.medflexj.entity.PatientNotes-139afd20-fef4-5713-061d-85282acba0fb [detached]], version = [4]
Note the “Text” showing in the log.info()
calls - the P screen has the correct, edited value - while the N screen does not, because it is re-loading the instance from the DB every time.
And also note this DOES not happen when deployed to a Tomcat container. (Tomcat 9.0.67, though I doubt the Tomcat version could cause this odd behavior.)
Any ideas here? This is mega-weird!