java - How do i properly cache common objects / entities when using JPA? -


i have web app needs load rows tables in database objects re-used in various places within application.

for instance, might retrieve list of locations change infrequently, want store in memory quicker access later on.

next, in future request, want associate 1 of these entities entity in database; however, jpa throws errors when attempting save, because cached entity detached.

how reattach cached entity can include in current transaction?

i'm using apache openjpa implementation.

calling entitymanager.merge() re-attach detached object.

have @ informative page


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -