<div><br></div><div>Hello All.</div><div><br></div><div>I am using OpenCms 7.0.3 with <a href="http://jboss-4.2.0.GA">jboss-4.2.0.GA</a> </div><div><br></div><div>org.opencms.db.CmsDbSqlException: An SQL error occurred when executing the following query: com.mysql.jdbc.ServerPreparedStatement[23] - INSERT INTO CMS_USERDATA (USER_ID,DATA_KEY,DATA_VALUE,DATA_TYPE) VALUES ('c300ba5c-01e8-3727-b305-5dcc9ccae1ee', 'USER_DESCRIPTION', x'', 'java.lang.String'). </div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.opencms.db.generic.CmsUserDriver.writeUserInfo(CmsUserDriver.java:1912)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.opencms.db.generic.CmsUserDriver.internalWriteUserInfos(CmsUserDriver.java:2606)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.opencms.db.generic.CmsUserDriver.writeUser(CmsUserDriver.java:1891)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.opencms.db.CmsDriverManager.loginUser(CmsDriverManager.java:4623)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.opencms.db.CmsSecurityManager.loginUser(CmsSecurityManager.java:2849)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.opencms.file.CmsObject.loginUser(CmsObject.java:2222)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.opencms.file.CmsObject.loginUser(CmsObject.java:2205)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at com.abc.XXXService.<init>(XXXService.java:80)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at com.abc.XXXXTest.<init>(XXXXTest.java:58)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at java.lang.reflect.Constructor.newInstance(Constructor.java:513)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at junit.framework.TestSuite.createTest(TestSuite.java:131)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at junit.framework.TestSuite.<init>(TestSuite.java:75)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)</div>
<div>Caused by: java.sql.SQLException: Duplicate entry 'c300ba5c-01e8-3727-b305-5dcc9ccae1ee-USER_DESCRIPTION' for key 1</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1129)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:681)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1368)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1283)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1268)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.opencms.db.generic.CmsUserDriver.writeUserInfo(CmsUserDriver.java:1910)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>... 22 more</div>
<div><br></div><div>My Test case is like Two Application Trying to login into Opencms(Different JVM ) simultaneously.</div><div><br></div><div><div>public XXXService() {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>try {<br>
</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>final XXXXShell cmsShell=new XXXXShell ("TOMCAT_WEB_INF"));</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>cmsObject = OpenCms.initCmsObject("GUEST_NAME"));</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>synchronized (cmsObject) {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>cmsObject.loginUser("Admin","admin");</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>cmsObject.getRequestContext().setCurrentProject(cmsObject.readProject(</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>"PROJECT_NAME"));</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>path = "RESOURCE_PATH";</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>} catch (Exception e) {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>e.printStackTrace();</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
</div><div><br></div><div>1. XXXXTest accessing XXXService service = new XXXService();</div><div><br></div><div>2. XXXXTest2 accessing XXXService service = new XXXService();</div><div><br></div><div>Please help</div>
<div><br></div><div>Regards</div><div>Govind R </div><div><br></div><div><br></div><div><br></div>