-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
bugSomething isn't workingSomething isn't working
Description
We have experienced a issue that reporting JPAContext has closed in automate testing of bookmark demo project.
Specifically the following endpoint:
@UrlContext("profiles")
public class ProfileService extends ServiceBase {
@GetAction("me")
@PropertySpec("email, roles.name")
public User myProfile() {
return me;
}
}The logic of rendering me result:
- Generate a RenderJSON object with payload be
me - Raise
BeforeResultCommitevent - captured byJPAPluginand then close the currentJPAContext mei.e. theUserclass has a methodgetRoles()method, which call toAAALookup.roles(roles), in which will result a request toJPADao.findOneBy(...)call
Since the current JPAContext has been closed already, thus the above JPADao.findOneBy call will raise exception complains that JPAContext is not available.
To handle this scenario, i.e. it require JPA database query after BeforeResultCommit event, we need to generate JPAContext for JPA queries.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working