Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Assuming that there are no major technical errors in your code, these errors are usually related to, as you have implied, the state of the data being returned by Entity manger.</p> <p><strong>Cluprit : The database?</strong></p> <p>Of course, you could have a cacheing issue in the underlying db. However, this is unlikely given your description of the system.out statements.</p> <p><strong>Culprit : The bean ?</strong></p> <p>The more likely culprit is that the query results are somehow being cached in the bean, or rather, in the query result set return value. If your test database allows dirty reads, that could be an explanation. This can be inspected by, for example, using an @Interceptor to refresh the query before any calls to getToys().</p> <p><strong>Another potential pitfall here : mistaking statelessness vs caching.</strong></p> <p>Finally : a brief word on statelessness. Although you are right that the stateless of the bean should result, generally speaking , in data which is not stale -- this is not always the case. The real definition of stateless beans in the EJB context is that those beans arent gauranteed to have state over the course of the application lifecycle. </p> <p>In summary there are 3 different ways to get to the bottom of your issue : </p> <p>1) Make sure the database isn't doing anything funny with dirty reads. 2) Test to see if intercepting the call to getToys(), and running / verifying the database query has no issues 3) Make sure that the type of statelessness that you want is actually being implemented by your ejb container.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload