more or less. Try to get a single transaction (ejb call if you want) by request.
Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau 2014-05-21 21:52 GMT+02:00 Howard W. Smith, Jr. <[email protected]>: > On Wed, May 21, 2014 at 3:42 PM, Romain Manni-Bucau > <[email protected]>wrote: > > > 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. foundEntity.property = entity.property > 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; > @Id > @GeneratedValue(strategy = GenerationType.IDENTITY) > @Basic(optional = false) > @NotNull > @Column(name = "AUDIT_TRAIL_ID") > private Integer auditTrailId; >
