3 Replies Latest reply on Jun 3, 2004 3:58 AM by vektom

    Relationship (post-table-create)

    speedyg_21

      Hi,

      I am using JBoss 3.2.3 with MySQL 4.0.17 and encountering issues populating the database with default values with CMP beans.

      The app. consists of a one-to-many relationship between the role bean and the user bean.

      jbosscmp-jdbc.xml

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
      
      <jbosscmp-jdbc>
       <defaults>
       <datasource>java:/DefaultDS</datasource>
       <datasource-mapping>mySQL</datasource-mapping>
       <create-table>true</create-table>
       <remove-table>false</remove-table>
       <pk-constraint>true</pk-constraint>
       <preferred-relation-mapping>relation-table</preferred-relation-mapping>
       </defaults>
       <enterprise-beans>
       <entity>
       <ejb-name>User</ejb-name>
       <post-table-create>
       <sql-statement>insert into user (email, password) values ('someone@polygone.be', 'test');</sql-statement>
       </post-table-create>
       <table-name>User</table-name>
       <cmp-field>
       <field-name>email</field-name>
       <column-name>email</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>password</field-name>
       <column-name>password</column-name>
       </cmp-field>
       </entity>
       <entity>
       <ejb-name>Role</ejb-name>
       <post-table-create>
       <sql-statement>insert into role (name) values ('admin');</sql-statement>
       </post-table-create>
       <table-name>Role</table-name>
       <cmp-field>
       <field-name>name</field-name>
       <column-name>name</column-name>
       </cmp-field>
       </entity>
       </enterprise-beans>
      
       <relationships>
       <ejb-relation>
       <ejb-relation-name>User-Role</ejb-relation-name>
       <relation-table-mapping>
       <table-name>user_roles</table-name>
       <create-table>true</create-table>
       <remove-table>false</remove-table>
       <post-table-create>
       <sql-statement>insert into user_roles (user, role) values ('someone@polygone.be', 'admin');</sql-statement>
       </post-table-create>
       <pk-constraint>true</pk-constraint>
       </relation-table-mapping>
       </ejb-relation>
       </relationships>
      </jbosscmp-jdbc>
      


      Default value insertion works well for both beans but fails for the relation
      I got an SQLException : Duplicate entry 'someone@polygone.be' for key 1"

      When I read the server.log file, I see that a wrong sql statement is chosen :

      issuePostCreateSQL::sql: [insert into user (email, password) values ('someone@polygone.be', 'test');] on table User
      issuePostCreateSQL::sql: [insert into role (name, description) values ('admin', 'Administrator');] on table Role
      issuePostCreateSQL::sql: [insert into user (email, password) values ('someone@polygone.be', 'test');] on table user_roles

      Why does the server choose the sql statement defined for the User bean (insert into user (email, password) values ('someone@polygone.be', 'test')) instead the statement defined for the relationship (insert into user_roles (user, role) values ('someone@polygone.be', 'admin')) ?
      In that situation, it's normal that I got this SQLException because the info has already been inserted in the user table.

      Is there something wrong with my configuration files ?
      How can I fix it ?

      Thanks,
      Olivier

      Here are my descriptors and stack trace when I start the server for the first time

      ejb-jar.xml
      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
      
      <ejb-jar>
      
       <enterprise-beans>
       <entity>
       <ejb-name>User</ejb-name>
       <local-home>com.polygone.security.auth.ejb.user.LocalUserHome</local-home>
       <local>com.polygone.security.auth.ejb.user.LocalUser</local>
       <ejb-class>com.polygone.security.auth.ejb.user.UserBean</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>java.lang.String</prim-key-class>
       <reentrant>True</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>User</abstract-schema-name>
       <cmp-field><field-name>email</field-name></cmp-field>
       <cmp-field><field-name>password</field-name></cmp-field>
       <primkey-field>email</primkey-field>
       <query>
       <description>method to find the authenticated users</description>
       <query-method>
       <method-name>findAll</method-name>
       <method-params/>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[select object (user) from User user]]></ejb-ql>
       </query>
       </entity>
       <entity>
       <ejb-name>Role</ejb-name>
       <local-home>com.polygone.security.auth.ejb.role.LocalRoleHome</local-home>
       <local>com.polygone.security.auth.ejb.role.LocalRole</local>
       <ejb-class>com.polygone.security.auth.ejb.role.RoleBean</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>java.lang.String</prim-key-class>
       <reentrant>True</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>Role</abstract-schema-name>
       <cmp-field><field-name>name</field-name></cmp-field>
       <primkey-field>name</primkey-field>
       <query>
       <description>method to find the roles</description>
       <query-method>
       <method-name>findAll</method-name>
       <method-params/>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql><![CDATA[select object (role) from Role role]]></ejb-ql>
       </query>
       </entity>
       <session>
       <ejb-name>Manager</ejb-name>
       <home>com.polygone.security.auth.ejb.manager.ManagerHome</home>
       <remote>com.polygone.security.auth.ejb.manager.Manager</remote>
       <ejb-class>com.polygone.security.auth.ejb.manager.ManagerBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       <ejb-local-ref>
       <ejb-ref-name>User</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <local-home>com.polygone.security.auth.ejb.user.LocalUserHome</local-home>
       <local>com.polygone.security.auth.ejb.user.LocalUser</local>
       <ejb-link>User</ejb-link>
       </ejb-local-ref>
       <ejb-local-ref>
       <ejb-ref-name>Role</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <local-home>com.polygone.security.auth.ejb.role.LocalRoleHome</local-home>
       <local>com.polygone.security.auth.ejb.role.LocalRole</local>
       <ejb-link>User</ejb-link>
       </ejb-local-ref>
       </session>
       </enterprise-beans>
      
       <relationships>
       <ejb-relation>
       <ejb-relation-name>User-Role</ejb-relation-name>
      
       <ejb-relationship-role>
       <ejb-relationship-role-name>user-has-roles</ejb-relationship-role-name>
       <multiplicity>Many</multiplicity>
       <relationship-role-source>
       <ejb-name>User</ejb-name>
       </relationship-role-source>
       <cmr-field>
       <cmr-field-name>roles</cmr-field-name>
       <cmr-field-type>java.util.Collection</cmr-field-type>
       </cmr-field>
       </ejb-relationship-role>
      
       <ejb-relationship-role>
       <ejb-relationship-role-name>role-has-users</ejb-relationship-role-name>
       <multiplicity>Many</multiplicity>
       <relationship-role-source>
       <ejb-name>Role</ejb-name>
       </relationship-role-source>
       </ejb-relationship-role>
       </ejb-relation>
       </relationships>
      
       <assembly-descriptor>
       <container-transaction>
       <method>
       <ejb-name>User</ejb-name>
       <method-name>*</method-name>
       </method>
       <trans-attribute>Required</trans-attribute>
       </container-transaction>
       <container-transaction>
       <method>
       <ejb-name>Role</ejb-name>
       <method-name>*</method-name>
       </method>
       <trans-attribute>Required</trans-attribute>
       </container-transaction>
       <container-transaction>
       <method>
       <ejb-name>Manager</ejb-name>
       <method-name>*</method-name>
       </method>
       <trans-attribute>Required</trans-attribute>
       </container-transaction>
       </assembly-descriptor>
      
      </ejb-jar>
      


      jboss.xml
      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
      
      <jboss>
       <enterprise-beans>
       <entity>
       <ejb-name>User</ejb-name>
       <local-jndi-name>ejb/User</local-jndi-name>
       <configuration-name>Standard CMP 2.x EntityBean</configuration-name>
       <clustered>false</clustered>
       </entity>
       <entity>
       <ejb-name>Role</ejb-name>
       <local-jndi-name>ejb/Role</local-jndi-name>
       <configuration-name>Standard CMP 2.x EntityBean</configuration-name>
       <clustered>false</clustered>
       </entity>
       <session>
       <ejb-name>Manager</ejb-name>
       <jndi-name>ejb/Manager</jndi-name>
       <configuration-name>Standard Stateless SessionBean</configuration-name>
       <clustered>false</clustered>
       </session>
       </enterprise-beans>
      </jboss>
      


      server.log
      2004-06-03 07:47:52,853 INFO [org.jboss.management.j2ee.LocalJBossServerDomain] Started jboss.management.local:j2eeType=J2EEDomain,name=Manager
      2004-06-03 07:47:52,853 INFO [org.jboss.logging.Log4jService] Started jboss.system:type=Log4jService,service=Logging
      2004-06-03 07:47:52,973 INFO [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] Running
      2004-06-03 07:47:52,973 INFO [org.jboss.web.WebService] Started WebServer with address: 0.0.0.0:8083
      2004-06-03 07:47:53,254 INFO [org.jboss.web.WebService] Using RMI server codebase: http://Tokyo:8083/
      2004-06-03 07:47:53,254 INFO [org.jboss.web.WebService] Started jboss:service=WebService
      2004-06-03 07:47:53,254 INFO [org.jboss.naming.NamingService] Starting jnp server
      2004-06-03 07:47:53,444 INFO [org.jboss.naming.NamingService] Started jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
      2004-06-03 07:47:53,454 INFO [org.jboss.naming.NamingService] Listening on port 1099
      2004-06-03 07:47:53,464 INFO [org.jboss.naming.NamingService] Started jboss:service=Naming
      2004-06-03 07:47:53,464 INFO [org.jboss.naming.JNDIView] Started jboss:service=JNDIView
      2004-06-03 07:47:53,464 INFO [org.jboss.security.plugins.SecurityConfig] Started jboss.security:service=SecurityConfig
      2004-06-03 07:47:53,514 INFO [org.jboss.security.auth.login.XMLLoginConfig] Started jboss.security:service=XMLLoginConfig
      2004-06-03 07:47:53,524 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Started jboss.security:service=JaasSecurityManager
      2004-06-03 07:47:53,714 INFO [org.jboss.tm.TransactionManagerService] Started jboss:service=TransactionManager
      2004-06-03 07:47:53,774 INFO [org.jboss.invocation.jrmp.server.JRMPInvoker] Started jboss:service=invoker,type=jrmp
      2004-06-03 07:47:53,875 INFO [org.jboss.invocation.jrmp.server.JRMPProxyFactory] Started jboss:service=proxyFactory,target=ClientUserTransactionFactory
      2004-06-03 07:47:53,885 INFO [org.jboss.invocation.jrmp.server.JRMPProxyFactory] Started jboss:service=proxyFactory,target=ClientUserTransaction
      2004-06-03 07:47:53,895 INFO [org.jboss.tm.usertx.server.ClientUserTransactionService] Started jboss:service=ClientUserTransaction
      2004-06-03 07:47:53,905 INFO [org.jboss.invocation.local.LocalInvoker] Started jboss:service=invoker,type=local
      2004-06-03 07:47:53,965 INFO [org.jboss.invocation.pooled.server.PooledInvoker] Started jboss:service=invoker,type=pooled
      2004-06-03 07:47:53,975 INFO [org.jboss.deployment.MainDeployer] Adding deployer: org.jboss.ejb.EJBDeployer@18c3679
      2004-06-03 07:47:53,975 INFO [org.jboss.ejb.EJBDeployer] Started jboss.ejb:service=EJBDeployer
      2004-06-03 07:47:53,975 INFO [org.jboss.deployment.MainDeployer] Adding deployer: org.jboss.deployment.EARDeployer@6779e6
      2004-06-03 07:47:53,975 INFO [org.jboss.deployment.EARDeployer] Started jboss.j2ee:service=EARDeployer
      2004-06-03 07:47:53,985 INFO [org.jboss.deployment.MainDeployer] Adding deployer: org.jboss.varia.deployment.BeanShellSubDeployer@659db7
      2004-06-03 07:47:53,985 INFO [org.jboss.varia.deployment.BeanShellSubDeployer] Started jboss.scripts:service=BSHDeployer
      2004-06-03 07:47:54,115 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/ant.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/bootstrap.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/catalina.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/commons-beanutils.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/commons-collections.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/commons-digester.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/commons-logging.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/jakarta-regexp-1.3.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/jasper-compiler.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/jasper-runtime.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/naming-common.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/naming-resources.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/servlets-common.jar
      2004-06-03 07:47:54,125 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/servlets-default.jar
      2004-06-03 07:47:54,245 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/servlets-invoker.jar
      2004-06-03 07:47:54,245 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/servlets-webdav.jar
      2004-06-03 07:47:54,245 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/tomcat-coyote.jar
      2004-06-03 07:47:54,245 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/tomcat-http11.jar
      2004-06-03 07:47:54,245 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/tomcat-jk2.jar
      2004-06-03 07:47:54,245 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/tomcat-util.jar
      2004-06-03 07:47:54,245 INFO [org.jboss.deployment.SARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/tomcat41-service.jar
      2004-06-03 07:47:56,228 INFO [STDOUT] Apache Tomcat/4.1.29
      2004-06-03 07:47:56,318 INFO [org.apache.coyote.http11.Http11Protocol] Initialisation de Coyote HTTP/1.1 sur le port 80
      2004-06-03 07:47:56,318 INFO [org.jboss.web.localhost.Engine] CoyoteConnector Coyote can't register jmx for protocol
      2004-06-03 07:47:56,328 INFO [org.apache.coyote.http11.Http11Protocol] Démarrage de Coyote HTTP/1.1 sur le port 80
      2004-06-03 07:47:56,328 INFO [org.jboss.web.tomcat.tc4.EmbeddedTomcatService] OK
      2004-06-03 07:47:56,328 INFO [org.jboss.deployment.MainDeployer] Adding deployer: org.jboss.web.tomcat.tc4.EmbeddedTomcatService@1c8ef56
      2004-06-03 07:47:56,328 INFO [org.jboss.web.tomcat.tc4.EmbeddedTomcatService] Started jboss.web:service=WebServer
      2004-06-03 07:47:56,538 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Projects/polygone/jboss/server/test/deploy/jbossweb-tomcat41.sar/
      2004-06-03 07:47:56,538 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Projects/polygone/jboss/server/test/deploy/jboss-jca.sar
      2004-06-03 07:47:56,999 INFO [org.jboss.deployment.XSLSubDeployer] Created templates: org.apache.xalan.templates.StylesheetRoot@1db484d
      2004-06-03 07:47:56,999 INFO [org.jboss.deployment.MainDeployer] Adding deployer: org.jboss.resource.RARDeployer@167d7fb
      2004-06-03 07:47:56,999 INFO [org.jboss.resource.RARDeployer] Started jboss.jca:service=RARDeployer
      2004-06-03 07:47:57,119 INFO [org.jboss.deployment.MainDeployer] Adding deployer: org.jboss.deployment.XSLSubDeployer@118278a
      2004-06-03 07:47:57,119 INFO [org.jboss.deployment.XSLSubDeployer] Started jboss.jca:service=ConnectionFactoryDeployer
      2004-06-03 07:47:57,119 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Projects/polygone/jboss/server/test/deploy/jboss-jca.sar
      2004-06-03 07:47:57,119 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Projects/polygone/jboss/server/test/deploy/jboss-local-jdbc.rar
      2004-06-03 07:47:57,420 INFO [org.jboss.resource.RARDeployer] nested deployment: file:/C:/Projects/polygone/jboss/server/test/tmp/deploy/tmp57329jboss-local-jdbc.rar-contents/jboss-local-jdbc.jar
      2004-06-03 07:47:57,450 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Projects/polygone/jboss/server/test/deploy/jboss-local-jdbc.rar
      2004-06-03 07:47:57,450 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Projects/polygone/jboss/server/test/deploy/mysql-ds.xml
      2004-06-03 07:47:57,760 INFO [org.jboss.resource.connectionmanager.RARDeployment] Started jboss.jca:service=ManagedConnectionFactory,name=DefaultDS
      2004-06-03 07:47:57,890 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Started jboss.jca:service=ManagedConnectionPool,name=DefaultDS
      2004-06-03 07:47:57,910 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Projects/polygone/jboss/server/test/deploy/mysql-ds.xml
      2004-06-03 07:47:57,910 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Projects/polygone/jboss/server/test/deploy/sqlexception-service.xml
      2004-06-03 07:47:58,021 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Projects/polygone/jboss/server/test/deploy/sqlexception-service.xml
      2004-06-03 07:47:58,021 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Projects/polygone/jboss/server/test/deploy/transaction-service.xml
      2004-06-03 07:47:58,051 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] Started jboss.jca:service=CachedConnectionManager
      2004-06-03 07:47:58,061 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.DefaultDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI name 'java:/DefaultDS'
      2004-06-03 07:47:58,061 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=DefaultDS
      2004-06-03 07:47:58,071 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Projects/polygone/jboss/server/test/deploy/transaction-service.xml
      2004-06-03 07:47:58,071 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Projects/polygone/jboss/server/test/deploy/test.ear
      2004-06-03 07:47:58,141 INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/C:/Projects/polygone/jboss/server/test/deploy/test.ear
      2004-06-03 07:47:59,503 INFO [org.jboss.ejb.EjbModule] Deploying User
      2004-06-03 07:47:59,513 INFO [org.jboss.ejb.EjbModule] Deploying Role
      2004-06-03 07:47:59,543 INFO [org.jboss.ejb.EjbModule] Deploying Manager
      2004-06-03 07:48:00,764 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.User] Initializing CMP plugin for User
      2004-06-03 07:48:00,774 INFO [org.jboss.ejb.plugins.EntityInstancePool] Started jboss.j2ee:jndiName=ejb/User,plugin=pool,service=EJB
      2004-06-03 07:48:00,774 INFO [org.jboss.ejb.EntityContainer] Started jboss.j2ee:jndiName=ejb/User,service=EJB
      2004-06-03 07:48:00,774 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.Role] Initializing CMP plugin for Role
      2004-06-03 07:48:01,205 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.User] Insert Entity SQL: INSERT INTO User (email, password) VALUES (?, ?)
      2004-06-03 07:48:01,205 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.User] Entity Exists SQL: SELECT COUNT(*) FROM User WHERE email=?
      2004-06-03 07:48:01,205 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.User] entity-command: [commandName=default,commandClass=class org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand,attributes={}]
      2004-06-03 07:48:01,215 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.User] Remove SQL: DELETE FROM User WHERE email=?
      2004-06-03 07:48:01,235 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.User] Executing SQL: CREATE TABLE User (email VARCHAR(250) BINARY NOT NULL, password VARCHAR(250) BINARY, CONSTRAINT pk_User PRIMARY KEY (email))
      2004-06-03 07:48:01,305 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.User] Created table 'User' successfully.
      2004-06-03 07:48:01,305 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.User] issuePostCreateSQL::sql: [insert into user (email, password) values ('someone@polygone.be', 'test');] on table User
      2004-06-03 07:48:01,305 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.User] Executing SQL: insert into user (email, password) values ('someone@polygone.be', 'test');
      2004-06-03 07:48:01,305 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.User] Issued SQL [insert into user (email, password) values ('someone@polygone.be', 'test');] successfully.
      2004-06-03 07:48:01,315 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.User#findByPrimaryKey] SQL: SELECT email FROM User WHERE email=?
      2004-06-03 07:48:01,325 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.User] Added findByPrimaryKey query command for local home interface
      2004-06-03 07:48:01,325 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.User#findAll] EJB-QL: select object (user) from User user
      2004-06-03 07:48:01,405 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.User#findAll] SQL: SELECT t0_user.email FROM User t0_user
      2004-06-03 07:48:01,756 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Role] Insert Entity SQL: INSERT INTO Role (name, description) VALUES (?, ?)
      2004-06-03 07:48:01,756 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Role] Entity Exists SQL: SELECT COUNT(*) FROM Role WHERE name=?
      2004-06-03 07:48:01,756 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.Role] entity-command: [commandName=default,commandClass=class org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand,attributes={}]
      2004-06-03 07:48:01,756 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.Role] Remove SQL: DELETE FROM Role WHERE name=?
      2004-06-03 07:48:01,756 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] Executing SQL: CREATE TABLE Role (name VARCHAR(250) BINARY NOT NULL, description VARCHAR(250) BINARY, CONSTRAINT pk_Role PRIMARY KEY (name))
      2004-06-03 07:48:01,826 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] Created table 'Role' successfully.
      2004-06-03 07:48:01,826 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] issuePostCreateSQL::sql: [insert into role (name, description) values ('admin', 'Administrator');] on table Role
      2004-06-03 07:48:01,826 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] Executing SQL: insert into role (name, description) values ('admin', 'Forum administrator');
      2004-06-03 07:48:01,826 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] Issued SQL [insert into role (name, description) values ('admin', 'Forum administrator');] successfully.
      2004-06-03 07:48:01,826 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] Executing SQL: CREATE TABLE user_roles (Role VARCHAR(250) BINARY NOT NULL, User VARCHAR(250) BINARY NOT NULL, CONSTRAINT pk_user_roles PRIMARY KEY (Role, User))
      2004-06-03 07:48:01,876 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] Created table 'user_roles' successfully.
      2004-06-03 07:48:01,876 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] issuePostCreateSQL::sql: [insert into user (email, password) values ('someone@polygone.be', 'test');] on table user_roles
      2004-06-03 07:48:01,876 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] Executing SQL: insert into user (email, password) values ('someone@polygone.be', 'test');
      2004-06-03 07:48:01,876 WARN [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Role] Issuing sql insert into user (email, password) values ('someone@polygone.be', 'test'); failed: java.sql.SQLException: Invalid argument value, message from server: "Duplicate entry 'someone@polygone.be' for key 1"
      2004-06-03 07:48:01,906 ERROR [org.jboss.ejb.EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: Error while issuing sql in post-table-create; - nested throwable: (java.sql.SQLException: Invalid argument value, message from server: "Duplicate entry 'someone@polygone.be' for key 1")
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.issuePostCreateSQL(JDBCStartCommand.java:392)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:154)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:484)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:388)
       at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:152)
       at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:342)
       at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
       at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
       at $Proxy14.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:394)
       at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy21.start(Unknown Source)