getSingleResult return no entity even if should be return one [message #1782826] |
Fri, 02 March 2018 08:14 |
IT Services Messages: 2 Registered: March 2018 |
Junior Member |
|
|
In my application, running on Payara (we've tried several release, from 164 to 174) and mysql, we use a query that retrieve some stable information about customer configuration.
The data in that table are quite stable (they are rarely edited, so no changes are occuring when the error appears neither write lock should be present).
We have some EJBs running (they run more or less every minute) launching one thread for each customer configuration, asking to retrieve those configuration details
Some times, some of those thread, at the same time, failed because of "return no entity", that's impossible. I've printed also the query that is launched, and it's correctly populated
No other error are launched in combination with this.
Seems like the db answer with empty response
Some time I receive independently from this error another error related to the db, com.sun.enterprise.resource.ConnectorXAResource handleResourceException, for a null pointer at com.sun.enterprise.resource.ConnectorXAResource.getResourceHandle(ConnectorXAResource.java:264). I don't think they are directly related, but they could depend both from the same problem
|
|
|
|
Re: getSingleResult return no entity even if should be return one [message #1783149 is a reply to message #1783144] |
Thu, 08 March 2018 14:08 |
IT Services Messages: 2 Registered: March 2018 |
Junior Member |
|
|
Hi,
Thanks for the reply
We have the same problem either with mariadb or mysql, using both connectors (the last downloadable)
In the application we have an entity (unmanaged because is open in a new thread/transaction by annotating with REQUIRES_NEW) called mailbox
the cal is
Configuration configuration = mailbox.getOwner().getCustomer().getConfiguration();
the getOwner part is
public User getOwner()
{
if (owner == null) {
owner = userHelper.getUserByMailbox(this);
}
return owner;
}
UserHelper is annotated as EJB, and getUserByMailbox return from a query with a getSingleResult
The get customer part is
public Customer getCustomer()
{
if (customer == null) {
customer = customerHelper.getCustomerByUser(this);
}
return customer;
}
Again, CustomerHelper is aan EJB, and this method (getCustomerByUser) )have no result
User and Customer are persisted to the DB, with no modification to both, and did no exist a user without customer
I don't know how investigate more, also regarding DB settings, because is a problem that happen only sometimes, while that row of code is called more or less 20.000 times a day, and it fail less than 10 times a day
|
|
|
Powered by
FUDForum. Page generated in 0.04382 seconds