3 ms·
JPA + EclipseLink. It's pretty simple: em.getTransaction().begin(); customer.setName("smith"); ::bunch of other atomic actions here:: em.getTransaction().co
by exabrial 4y ago
JPA + EclipseLink. It's pretty simple:
em.getTransaction().begin();
customer.setName("smith");
::bunch of other atomic actions here::
em.getTransaction().commit():
JPA offers caching, cache eviction, and falls back to automatic
Version columns (update customer where name = bob and version = 1 set name = smith, version = 2). We use ActiveMQ to put cache eviction notices onto a Topic and distribute them out the JVMs that advertise interest in the objects.
Cache hits can be obtained by "business key" like "cust-00001" (or primary key internally)... A common use case is not causing database I/O on RESTful URLs: http://example.com/customer/cust-00001 http://example.com/customer/cust-00001
Granted there is some really complex stuff we dip into native SQL and stored procedures, but JPA does 95% of everything and we handle everything else as it comes. Highly recommend.