[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3587) Spring example on AS 5 throwns a non-jta-data-source error while deploying
by Jay Balunas (JIRA)
Spring example on AS 5 throwns a non-jta-data-source error while deploying
--------------------------------------------------------------------------
Key: JBSEAM-3587
URL: https://jira.jboss.org/jira/browse/JBSEAM-3587
Project: Seam
Issue Type: Bug
Components: Examples
Affects Versions: 2.1.0.CR1
Environment: JDK 6
AS 5 CR2
Reporter: Jay Balunas
Assignee: Michael Youngstrom
Fix For: 2.1.1.CR1
during deployment the spring example throws the exception below. The persistence.xml looks like this:
<persistence-unit name="bookingDatabase" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
note that this example does work on JBoss 4.2.3.
15:56:37,345 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=#bookingDatabase
15:56:37,351 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#bookingDatabase state=Create
java.lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a non-jta-data-source for a RESOURCE_LOCAL enabled persistence context named: bookingDatabase
at org.jboss.jpa.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:124)
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:262)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:124)
at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java
--
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
16 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3579) GroovyBooking example throws SQL exceptions on AS 5 CR2
by Jay Balunas (JIRA)
GroovyBooking example throws SQL exceptions on AS 5 CR2
-------------------------------------------------------
Key: JBSEAM-3579
URL: https://jira.jboss.org/jira/browse/JBSEAM-3579
Project: Seam
Issue Type: Bug
Components: Examples
Affects Versions: 2.1.0.CR1, 2.0.3.CR1
Environment: JDK 6
Fedora 8
AS 5 CR2
Reporter: Jay Balunas
Fix For: 2.1.0.GA
During deployment the exception below is thrown. This was seem in both 2.1.0.GA testing, and 2.0.3.CR1 testing with AS 5 CR2
10:34:46,875 INFO [SchemaExport] exporting generated schema to database
10:34:46,876 INFO [SchemaExport] Executing import script: /import.sql
10:34:46,877 ERROR [SchemaExport] schema export unsuccessful
org.hibernate.JDBCException: Error during import script execution at line 1
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:332)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:264)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:211)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:343)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:85)
at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
at org.jboss.seam.Component.callComponentMethod(Component.java:2179)
at org.jboss.seam.Component.callCreateMethod(Component.java:2094)
at org.jboss.seam.Component.newInstance(Component.java:2054)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:112)
at org.jboss.seam.init.Initialization.init(Initialization.java:727)
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3887)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4370)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:352)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:140)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:459)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
at $Proxy35.start(Unknown Source)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.system.ServiceController.doChange(ServiceController.java:672)
at org.jboss.system.ServiceController.start(ServiceController.java:444)
at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:146)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:104)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:45)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1024)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Violation of unique constraint SYS_PK_49: duplicate value(s) for column(s) $$
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.execute(Unknown Source)
at org.jboss.resource.adapter.jdbc.WrappedStatement.execute(WrappedStatement.java:91)
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:328)
... 87 more
--
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
16 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3823) Interceptor implementation limits Interceptors annotation to one class
by Lars Huber (JIRA)
Interceptor implementation limits Interceptors annotation to one class
-----------------------------------------------------------------------
Key: JBSEAM-3823
URL: https://jira.jboss.org/jira/browse/JBSEAM-3823
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.1.1.GA
Environment: Seam nightly build
Reporter: Lars Huber
The implementation of the Seam Interceptor restricts the custom Interceptors to one class. In the Seam code is written to remove this silly restriction (see code below).
@Interceptors({FirstInterceptor.class, SecondInterceptor.class}) // does not work due to impl restriction
public Interceptor(Class[] classes, Annotation annotation, Component component)
{
if (classes.length!=1)
{
//TODO: remove this silly restriction!
throw new IllegalArgumentException("Must be exactly one interceptor when used as a meta-annotation");
}
userInterceptorClass = classes[0];
...
Also the @Interceptors is only possible in Annotation declaration and not on classes. This forces you to create for each Interceptor an appropriate annotation (see workaround)
--
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
16 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3653) Remove String concat in ScopeType
by Michael Youngstrom (JIRA)
Remove String concat in ScopeType
---------------------------------
Key: JBSEAM-3653
URL: https://jira.jboss.org/jira/browse/JBSEAM-3653
Project: Seam
Issue Type: Bug
Affects Versions: 2.1.0.GA, 2.0.3.CR1
Reporter: Michael Youngstrom
Assignee: Michael Youngstrom
Fix For: 2.1.1.CR1
In my application profiling the SeamELResolver is an extremely hot spot. This is one seemingly harmless fix that can be applied to minimally improve component lookup and hence SeamELResolver performance. This fix may appear small but in my app this method is getting called thousands of times a page load.
Index: src/main/org/jboss/seam/ScopeType.java
===================================================================
--- src/main/org/jboss/seam/ScopeType.java (revision 9465)
+++ src/main/org/jboss/seam/ScopeType.java (working copy)
@@ -69,6 +69,12 @@
*/
UNSPECIFIED;
+ private final String prefix;
+
+ private ScopeType() {
+ prefix = "org.jboss.seam." + toString();
+ }
+
public boolean isContextActive()
{
switch (this)
@@ -151,7 +157,7 @@
public String getPrefix()
{
- return "org.jboss.seam." + toString();
+ return prefix;
}
}
--
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
16 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1922) Back button doesn't work with PAGE scope and JSF-RI Server state saving
by Michael Youngstrom (JIRA)
Back button doesn't work with PAGE scope and JSF-RI Server state saving
-----------------------------------------------------------------------
Key: JBSEAM-1922
URL: http://jira.jboss.com/jira/browse/JBSEAM-1922
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.BETA1
Reporter: Michael Youngstrom
JSF doesn't make any guarentees about the isolation of attributes stored in the view. Because of this a PAGE scoped component that gets passed along to several views will actually be a single instance when using Server state management with the RI.
This causes a problem with back button support for the PAGE scope (imho the main difference of PAGE scope over CONVERSATION). For example:
@Name("test")
@Scope(PAGE)
public class Test implements Serializable {
private int value = 0;
public int getValue() {
return value;
}
public void incValue() {
value++;
}
}
Value = #{test.value}
<h:form>
<h:commandButton action="#{test.incValue}" value="Increment Value"/>
</h:form>
Test Case when using Server side state management:
1. I view the page: "Value = 0" Displayed
2. I press "Increment" button: "Value = 1"
3. I press "Increment" button: "Value = 2"
4. I press "back" button: "Value = 1"
5. I press "Increment" button: "Value=3"
If running in client state mode Step 5 displays "Value=2".
To make PAGE scope work consistently between client and server JSF state management we need to figure out some way to serialize PAGE scoped values when doing "saveState" or something so that a new instance of PAGE is accessed from restore-view of any subsequent requests.
Here is a link to a conversation on the RI about this issue:
https://javaserverfaces.dev.java.net/servlets/BrowseList?list=dev&by=thre...
>From the conversation it appears the MyFaces is not effected by this issue by default.
--
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
16 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3654) Reduce number of checks to see if Jbpm is installed in BusinessProcessContext
by Michael Youngstrom (JIRA)
Reduce number of checks to see if Jbpm is installed in BusinessProcessContext
-----------------------------------------------------------------------------
Key: JBSEAM-3654
URL: https://jira.jboss.org/jira/browse/JBSEAM-3654
Project: Seam
Issue Type: Bug
Affects Versions: 2.1.0.GA
Reporter: Michael Youngstrom
Assignee: Michael Youngstrom
Fix For: 2.1.1.CR1
In my application profiling the SeamELResolver is an extremely hot spot. Although checking to see if jbpm is installed would appear a rather efficient process when done thousands of times a request it can become harmful. BusinessProcessContext.get is called every time an el expression is evaluated in a page. Here is a simple and I believe safe patch that will help make BusinessProcessContext more efficient. isJbpmInstalled() is only called once a request.
Index: src/main/org/jboss/seam/contexts/Lifecycle.java
===================================================================
--- src/main/org/jboss/seam/contexts/Lifecycle.java (revision 9465)
+++ src/main/org/jboss/seam/contexts/Lifecycle.java (working copy)
@@ -81,11 +81,11 @@
public static void beginCall()
{
log.debug( ">>> Begin call" );
+ Contexts.applicationContext.set( new ApplicationContext(getApplication()) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.sessionContext.set( new BasicContext(ScopeType.SESSION) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
Contexts.businessProcessContext.set( new BusinessProcessContext() );
- Contexts.applicationContext.set( new ApplicationContext(getApplication()) );
}
public static void endCall()
Index: src/main/org/jboss/seam/contexts/BusinessProcessContext.java
===================================================================
--- src/main/org/jboss/seam/contexts/BusinessProcessContext.java (revision 9465)
+++ src/main/org/jboss/seam/contexts/BusinessProcessContext.java (working copy)
@@ -35,21 +35,26 @@
private final Map<String, Object> additions = new HashMap<String, Object>();
private final Set<String> removals = new HashSet<String>();
+ private final boolean enabled;
public ScopeType getType()
{
return ScopeType.BUSINESS_PROCESS;
}
- public BusinessProcessContext() {}
+ public BusinessProcessContext() {
+ enabled = Init.instance().isJbpmInstalled();
+ }
public Object get(String name)
{
-
Object result = additions.get(name);
if (result!=null) return result;
if ( removals.contains(name) ) return null;
-
+
+ if(!enabled) {
+ return null;
+ }
org.jbpm.taskmgmt.exe.TaskInstance taskInstance = getTaskInstance();
if (taskInstance==null)
{
Index: src/main/org/jboss/seam/contexts/TestLifecycle.java
===================================================================
--- src/main/org/jboss/seam/contexts/TestLifecycle.java (revision 9465)
+++ src/main/org/jboss/seam/contexts/TestLifecycle.java (working copy)
@@ -29,11 +29,11 @@
public static void beginTest(ServletContext context, Map<String, Object> session)
{
log.debug( ">>> Begin test" );
+ Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap(context) ) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
Contexts.businessProcessContext.set( new BusinessProcessContext() );
Contexts.sessionContext.set( new SessionContext(session) );
- Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap(context) ) );
}
public static void endTest()
--
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
16 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3656) Eliminate unnecessary String concat in PageContext
by Michael Youngstrom (JIRA)
Eliminate unnecessary String concat in PageContext
--------------------------------------------------
Key: JBSEAM-3656
URL: https://jira.jboss.org/jira/browse/JBSEAM-3656
Project: Seam
Issue Type: Bug
Components: Core
Reporter: Michael Youngstrom
Assignee: Michael Youngstrom
Fix For: 2.1.1.CR1
PageContext has an unnecessary string concat that would normally be harmless but when done thousands of times a request becomes a bigger problem. Here is the patch:
Index: src/main/org/jboss/seam/contexts/PageContext.java
===================================================================
--- src/main/org/jboss/seam/contexts/PageContext.java (revision 9465)
+++ src/main/org/jboss/seam/contexts/PageContext.java (working copy)
@@ -38,6 +38,7 @@
public class PageContext implements Context
{
+ private static final String PAGE_CONTEXT_PREFIX = ScopeType.PAGE.getPrefix() + '$';
private Map<String, Object> previousPageMap;
private Map<String, Object> nextPageMap;
@@ -59,7 +60,7 @@
private String getPrefix()
{
- return ScopeType.PAGE.getPrefix() + '$';
+ return PAGE_CONTEXT_PREFIX;
}
public Object get(String name)
--
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
16 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3655) Caching in ServerConversationContext
by Michael Youngstrom (JIRA)
Caching in ServerConversationContext
-------------------------------------
Key: JBSEAM-3655
URL: https://jira.jboss.org/jira/browse/JBSEAM-3655
Project: Seam
Issue Type: Bug
Components: Core
Reporter: Michael Youngstrom
Assignee: Michael Youngstrom
Fix For: 2.1.1.CR1
In my application profiling the SeamELResolver is an extremely hot spot. ServerConversationContext was the hottest. I think it would be safe to create a request scoped cache on ServerCovnersationContext. I believe nobody can really be add or removing values from the conversation without going through the ServerConversationContext. In my tests caching resolution of conversation values greatly improved EL performance.
Index: src/main/org/jboss/seam/contexts/ServerConversationContext.java
===================================================================
--- src/main/org/jboss/seam/contexts/ServerConversationContext.java (revision 9465)
+++ src/main/org/jboss/seam/contexts/ServerConversationContext.java (working copy)
@@ -36,6 +36,7 @@
private final Set<String> removals = new HashSet<String>();
private final String id;
private final List<String> idStack;
+ private final Map<String, Object> cache = new HashMap<String, Object>();
private List<String> getIdStack()
{
@@ -81,8 +82,15 @@
this.idStack = new LinkedList<String>();
idStack.add(id);
}
+
+ public Object get(String name) {
+ if (!cache.containsKey(name)) {
+ cache.put(name, resolveValue(name));
+ }
+ return cache.get(name);
+ }
- public Object get(String name)
+ protected Object resolveValue(String name)
{
Object result = additions.get(name);
if (result!=null)
@@ -148,6 +156,7 @@
public void set(String name, Object value)
{
if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.preSetVariable." + name);
+ cache.remove(name);
if (value==null)
{
//yes, we need this
@@ -185,6 +194,7 @@
public void remove(String name)
{
if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.preRemoveVariable." + name);
+ cache.remove(name);
additions.remove(name);
removals.add(name);
if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.postRemoveVariable." + name);
@@ -245,6 +255,7 @@
public void clear()
{
+ cache.clear();
additions.clear();
removals.addAll( getNamesFromSession() );
}
--
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
16 years, 1 month