Quantcast
Channel: GlassFish Related Items on Java.net
Viewing all articles
Browse latest Browse all 1091

JAX-RS GET request gives EJBTransactionRolledbackException every fifth time

$
0
0

Hi. I have a pretty simple service that looks like this

<br />
  @GET<br />
  @Path("/list")<br />
  public Response getList() {<br />
      TypedQuery<Glyph> query = em.createNamedQuery(Glyph.FIND_ALL, Glyph.class);<br />
      Glyphs glyphs = new Glyphs(query.getResultList());<br />
      return Response.ok(glyphs).build();<br />
  }<br />

Hitting the url works perfectly fine, except that (predictably) I get a javax.ejb.EJBTransactionRolledbackException every fifth time I request the url.

I really don't understand why this would happen. I actually don't even understand why there's a transaction involved at all. I'm pretty sure all this is doing is a "select * from some_table".
Let me know if you want to see the Glyph and Glyphs classes, but they're just straight-up Entity objects.

Edit: The root cause is actually javax.ejb.TransactionRolledbackLocalException


Viewing all articles
Browse latest Browse all 1091

Trending Articles