[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2093) Optimize getting Id in Seam code for better performance
by Mikhail Grushinskiy (JIRA)
Optimize getting Id in Seam code for better performance
-------------------------------------------------------
Key: JBSEAM-2093
URL: http://jira.jboss.com/jira/browse/JBSEAM-2093
Project: JBoss Seam
Issue Type: Feature Request
Reporter: Mikhail Grushinskiy
This sequence of calls (used in PersistenceProvider) is quite slow
Entity.forClass(bean.getClass()).getIdentifier(bean);
1) Entity.forClass() is reading annotations using JDK 5 methods (JDK 5 annotation reading is not that fast). Can it be cached?
2) JDK 5 reflection is used to get bean id (which is slower than optmized reflection with cglib)
3) There could be other reasons as well. I think repetitive calling of this sequence under profiler will give better picture.
from PersistenceProvider.java
/**
* Get the value of the entity identifier attribute.
*
* @param bean a managed entity instance
*/
public Object getId(Object bean, EntityManager entityManager)
{
return Entity.forClass( bean.getClass() ).getIdentifier(bean);
}
/**
* Get the name of the entity
*
* @param bean
* @param entityManager
*/
public String getName(Object bean, EntityManager entityManager)
{
return Entity.forClass(bean.getClass()).getName();
}
/**
* Get the value of the entity version attribute.
*
* @param bean a managed entity instance
*/
public Object getVersion(Object bean, EntityManager entityManager)
{
return Entity.forClass( bean.getClass() ).getVersion(bean);
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4335) support "with" in dynamic restrictions
by Daniel Tomsu (JIRA)
support "with" in dynamic restrictions
--------------------------------------
Key: JBSEAM-4335
URL: https://jira.jboss.org/jira/browse/JBSEAM-4335
Project: Seam
Issue Type: Feature Request
Components: Framework
Affects Versions: 2.2.0.GA
Reporter: Daniel Tomsu
Priority: Minor
I would like the org.jboss.seam.framework.EntityQuery to understand WITH as a restriction, right now only where is correctly understood.
This will lead to problems with outer joins where a constraint can not be expressed in a where clause.
For example my EJBQL is:
select new entity.combined.EmployeePerformance(employee, performance) from Employee as employee left outer join employee.performances as performance
my restrictions are:
with performance.process=#{processManager.currentProcess}
where (employee.id in (#{sessionView.employeeIds})
In my opinion there should be two restriction categories with and where, which both allow EL expressions.
My quick fix was to form a dynamic EJBQL, dependent on the processManager, which concats to the EJBQL the desired with expression.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4332) HTTP sessions expiration cause a "javax.naming.ConfigurationException" while trying to "Destroy" the EntityManager components in WebSphere
by Denis Forveille (JIRA)
HTTP sessions expiration cause a "javax.naming.ConfigurationException" while trying to "Destroy" the EntityManager components in WebSphere
------------------------------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-4332
URL: https://jira.jboss.org/jira/browse/JBSEAM-4332
Project: Seam
Issue Type: Bug
Affects Versions: 2.2.0.GA
Environment: Seam 2.2.0 GA, WebSphere 7.0.0.5
Reporter: Denis Forveille
Assignee: Denis Forveille
Fix For: 2.2.1.CR1
In WebSphere when the HTTP user session expires, the Seam session listener intercepts the event and try to clean all the pending components
A call to the method annotated "@Destroy" is called on EntityManager (ie method close())
This methods checks if there is an active Transaction to throw an exception in case there is an active transaction. For this it performs a JNDI lookup on java:comp/env/UserTransaction
In this context, the lookup fails with a javax.naming.ConfigurationException in WebSphere because it is illegal to do such operation in such a thread (The one spawned by WebSphere to timeout the session) and the EntityManager is never closed and the whole clean process fails..
This can be corrected by intercepting the exception in the ManagedPersistenceContext.close() method and continue with the close operation on the EntityManager
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months