ActiveObjects removes and refetches Enum values from the database

Description

See: net.java.ao.EntityManager#find
The following line will put a String value into the cache layer

1 cacheLayer.put(cacheField, res.getObject(cacheField));

This causes net.java.ao.EntityProxy#invokeGetter to remove it from the map and refetch it from the database for no reason. See block which starts with:

1 } else if (shouldCache && cacheLayer.contains(name)) {

I believe the fix is calling:

1 databaseType.getLogicalType().pullFromDatabase(this.manager, res, type, field);

in the following block in the EntityManager:

1 2 3 4 for (String cacheField : canonicalFields) { cacheLayer.put(cacheField, res.getObject(cacheField)); }

Environment

None

Testing Notes

None

Status

Assignee

Unassigned

Reporter

jhinch

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Story Points

0.5

Components

Priority

Critical
Configure