tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <>
Subject Re: question around entityManager.flush
Date Wed, 21 May 2014 19:52:30 GMT
On Wed, May 21, 2014 at 3:42 PM, Romain Manni-Bucau

> what I say is you can do eveything in a single method method.

Sounds like you are recommending something similar to the following:

1. @RequestScoped bean to get data to display in UI layer to enduser

2. If user modifies data, and data is submitted from client/UI to
server/bean (@Session/ViewScoped/RequestScoped), then pass modified @Entity
from Session/View/RequestScoped bean to @Stateless @EJB, and

3. @Stateless @EJB method(@Entity entity) does the following:

a. find entity via SELECT or find
b. =
c. repeat step 'b.' above for all properties
d. edit(foundEntity)

are you recommending something like this (above)?

> The fact you need flush means your operation need a state provided by the
> database (@GeneratedValue?).
public class AuditTrail implements Serializable {
    private static final long serialVersionUID = 1L;
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "AUDIT_TRAIL_ID")
    private Integer auditTrailId;

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message