tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <smithh032...@gmail.com>
Subject Re: question around entityManager.flush
Date Wed, 21 May 2014 19:56:38 GMT
okay, I will have to try that, asap, and report my/some test results.
thanks.



On Wed, May 21, 2014 at 3:54 PM, Romain Manni-Bucau
<rmannibucau@gmail.com>wrote:

> 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. <smithh032772@gmail.com>:
>
> > On Wed, May 21, 2014 at 3:42 PM, Romain Manni-Bucau
> > <rmannibucau@gmail.com>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;
> >
>

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