[jboss-user] [JBoss Seam] - SMPC Configuration

monkeyden do-not-reply at jboss.com
Wed Jul 11 15:44:40 EDT 2007


I'm running JMeter against a screen in my application and it's failing miserably, so I created a rudimentary test case and it's failing also.  I'm guessing that I have something misconfigured.  Here is what I have:

<persistence xmlns="http://java.sun.com/xml/ns/persistence" 
  |              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |              xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
  |              version="1.0">
  |              
  |    <persistence-unit name="dcdb">
  |       <provider>org.hibernate.ejb.HibernatePersistence</provider>
  |       <jta-data-source>java:/ds_dcdb</jta-data-source>
  |       <properties>
  |          <property name="hibernate.hbm2ddl.auto" value="none"/>
  |          <property name="hibernate.cache.use_query_cache" value="true"/>
  |          <property name="hibernate.show_sql" value="true"/>
  |          <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />
  |          <property name="jboss.entity.manager.factory.jndi.name" value="java:/dcdb"/>
  |          <property name="hibernate.default_schema" value="dcdb"/>
  |       </properties>
  |    </persistence-unit>
  |    <persistence-unit name="images">
  |       <provider>org.hibernate.ejb.HibernatePersistence</provider>
  |       <jta-data-source>java:/ds_images</jta-data-source>
  |       <properties>
  |          <property name="hibernate.hbm2ddl.auto" value="none"/>
  |          <property name="hibernate.cache.use_query_cache" value="true"/>
  |          <property name="hibernate.show_sql" value="true"/>
  |          <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />
  |          <property name="jboss.entity.manager.factory.jndi.name" value="java:/images"/>
  |          <property name="hibernate.default_schema" value="img"/>
  |       </properties>
  |    </persistence-unit>
  | </persistence>

components.xml
<core:managed-persistence-context name="dcdbEM" persistence-unit-jndi-name="java:/dcdb" auto-create="true"/>

pages.xml
<page view-id="/test/testEmployee.xhtml" action="#{testEmployeeAction.loadEmployee}"/>

Action
@Name("testEmployeeAction")
  | @Scope(ScopeType.SESSION)
  | public class TestEmployeeAction {
  | 
  |     @Logger
  |     private static Log log;
  |     
  |     Employee employee;
  |     
  |     @Create
  |     public void create(){
  |         
  |     }
  |     
  |     public void loadEmployee(){
  |         EmployeeBO employeeBO = (EmployeeBO)Component.getInstance("employeeBO");
  |         this.employee = (Employee)employeeBO.findByPrimaryKey(new Long(206485));
  |         log.debug("Employee found: #0", employee.getFullName());
  |     }
  | 
  |     /**
  |      * @return the employee
  |      */
  |     public Employee getEmployee() {
  |         return employee;
  |     }
  | 
  |     /**
  |      * @param employee the employee to set
  |      */
  |     public void setEmployee(Employee employee) {
  |         this.employee = employee;
  |     }
  | }
  | 

The entity
@Entity
  | @Name("employee")
  | @Table(name = "DWL_EMPLOYEES")
  | public class Employee extends EmployeeBase implements java.io.Serializable {
  | 
  |     @Id
  |     @Column(name = "EMPLOYEE_ID", length = 22, nullable = false)
  |     public Long getEmployeeId() {
  |         return this.employeeId;
  |     }
  | 
  |     public void setEmployeeId(Long employeeId) {
  |         this.employeeId = employeeId;
  |     }
  | 
  |     @Column(name = "FIRST_NAME", length = 30, nullable = true)
  |     public String getFirstName() {
  |         return this.firstName;
  |     }
  | 
  |     public void setFirstName(String firstName) {
  |         this.firstName = firstName;
  |     }
  |     ...
  | 

And in the view I use facelets
<ui:define name="body">
  |         <h:form id="testEmployeeForm">
  |             #{testEmployeeAction.employee.firstName}
  |         </h:form>
  |     </ui:define>

The page works fine with a single request from the browser but under load,  the whole document is sent in the response but my assertion fails (i.e. the employee name is not displayed).  In fact, when using just 10 threads, 7 of them fail.

Thanks for any advice.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063178#4063178

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063178



More information about the jboss-user mailing list