Hi Luciano,
I exposed a function called addProcessNodeStatus to web service and my
stress test code calls the web service from a helper class named as
EdiTraceHelper.
Here is the stress test code.
public class TraceThread implements Runnable{
......
public void run() {
for (int i=0;i<100;i++){
EdiTraceHelper traceHelper = new
EdiTraceHelper();//it is the web service client proxy helper class
int
value=traceHelper.addProcessNodeStatus((new Integer(this.seq)).toString(),
fileName, sysID, statusCode, statusValue, userId);
}
}
}
public class EdiTraceHelperStressTest {
public static void main(String[] arg) {
for (int i = 0; i <100; i++) {
new Thread(new TraceThread(i)).start();
}
}
}
On the server side,the addProcessNodeStatus is like the following:
public int addProcessNodeStatus(String ReqID, String FileName, String
SysID, String StatusCode,String StatusValue ,String userId){
if(ReqID==null|| FileName==null|| SysID==null|| StatusCode==null||
StatusValue==null||userId==null)
return -3;
DAS dasWorker=getDasViaConfigFile();//this function calls
DAS.FACTORY.createDAS(InputStream)
ProcessStatusDao psd=new ProcessStatusDao();
try{
psd.insertProcessStatus(dasWorker, ReqID, FileName, SysID,
StatusCode, StatusValue, userId,
DateFormatHelper.getFormattedDate(DATE_FORMAT));
}catch (Exception e){
dasWorker.releaseResources();
System.out.println(e.getMessage());
return -1;
}
dasWorker.releaseResources();
return 0;
}
I have tried to solve the ConcurrentModificationException problem via
creating an DAS POOL using Vector to avoid concurrently calling
DAS.FACTORY.createDAS()function, and it works well.
But I think it is better to solve the ConcurrentModificationException at
org.eclipse.emf.common.util.BasicEList$EIterator.checkModCount(BasicEList.java:1327)
More information if you need, just let me know. :)
Thank you very much!
Michael
-----邮件原件-----
发件人: Luciano Resende [mailto:[EMAIL PROTECTED]
发送时间: 2008年8月4日 1:05
收件人: [email protected]
抄送: raozhl/Rao Zhenlin(IT)
主题: Re: ConcurrentModificationException problem when doing stress testing on
TUSCANY DAS
Hi Michael
Would you be able to provide me with a piece of yout stress test
that would help me see the same problem localy and investigate the
issue ? In the meantime I'll do some more investigation and see if I
can find out more about the issue.
Thanks
On Mon, Jul 28, 2008 at 8:25 PM, raozhl/Rao Zhenlin(IT)
<[EMAIL PROTECTED]> wrote:
> Dear Sir or Madam,
>
> Tuscany DAS 1.0 beta2 may have concurrent Modification problem under stress
> testing environment
>
>
>
> The following Exception at
> org.eclipse.emf.common.util.BasicEList$EIterator.checkModCount(BasicEList.java:1327)
>
> surely occurred when concurrently invoke
> org.apache.tuscany.das.rdb.impl.DASFactoryImpl.createDAS
>
> Test Case 1:
>
> Generated 10 threads concurrently, each thread does 100 insert commands in
> loop, 500 request in total, finally I got 55 request failed, above 11% fail
> rate, all was caused by the following exception
>
>
>
> Test Case 2:
>
> Generated 2 threads concurrently, each thread does 100 insert commands in
> loop, 200 request in total, finally I got 5 request failed, about 2.5% fail
> rate, all was caused by the following exception
>
>
>
> WAS CE 2.0.0.2
>
> CPU 1.4MHZ centrino, 1.25G memory(512m was used on WAS CE server instance)
>
> SYBASE 12.5
>
> DAS was configured using database pool on WASCE
>
>
>
> I am wondering if there would be a hot fix on it
>
> Thank you
>
>
>
>
>
> Best Regards
>
> Michael
>
>
>
> java.util.ConcurrentModificationException
>
> at
> org.eclipse.emf.common.util.BasicEList$EIterator.checkModCount(BasicEList.java:1327)
>
> at
> org.eclipse.emf.common.util.BasicEList$EIterator.next(BasicEList.java:1275)
>
> at
> org.eclipse.xsd.impl.XSDSchemaImpl.changeReference(XSDSchemaImpl.java:2432)
>
> at
> org.eclipse.xsd.impl.XSDConcreteComponentImpl.eNotify(XSDConcreteComponentImpl.java:1221)
>
> at
> org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:234)
>
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:302)
>
> at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:600)
>
> at org.eclipse.xsd.impl.XSDSchemaImpl.imported(XSDSchemaImpl.java:2985)
>
> at
> org.eclipse.xsd.impl.XSDImportImpl.handleResolvedSchema(XSDImportImpl.java:424)
>
> at
> org.eclipse.xsd.impl.XSDSchemaDirectiveImpl.resolve(XSDSchemaDirectiveImpl.java:387)
>
> at
> org.eclipse.xsd.impl.XSDImportImpl.importSchema(XSDImportImpl.java:411)
>
> at
> org.eclipse.xsd.impl.XSDSchemaImpl.resolveSchema(XSDSchemaImpl.java:2136)
>
> at
> org.eclipse.xsd.impl.XSDSchemaImpl.resolveNamedComponent(XSDSchemaImpl.java:2164)
>
> at
> org.eclipse.xsd.impl.XSDSchemaImpl.resolveSimpleTypeDefinition(XSDSchemaImpl.java:2240)
>
> at
> org.eclipse.xsd.impl.XSDConcreteComponentImpl.resolveSimpleTypeDefinition(XSDConcreteComponentImpl.java:2374)
>
> at
> org.eclipse.xsd.impl.XSDAttributeDeclarationImpl.patch(XSDAttributeDeclarationImpl.java:189)
>
> at
> org.eclipse.xsd.impl.XSDConcreteComponentImpl.patch(XSDConcreteComponentImpl.java:526)
>
> at org.eclipse.xsd.impl.XSDSchemaImpl.patch(XSDSchemaImpl.java:1505)
>
> at
> org.eclipse.xsd.impl.XSDSchemaImpl.changeAttribute(XSDSchemaImpl.java:2335)
>
> at
> org.eclipse.xsd.impl.XSDConcreteComponentImpl.eNotify(XSDConcreteComponentImpl.java:1240)
>
> at
> org.eclipse.xsd.impl.XSDSchemaImpl.setSchemaLocation(XSDSchemaImpl.java:829)
>
> at org.eclipse.xsd.util.XSDResourceImpl.doLoad(XSDResourceImpl.java:756)
>
> at org.eclipse.xsd.util.XSDResourceImpl.load(XSDResourceImpl.java:617)
>
> at
> org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:233)
>
> at
> org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:224)
>
> at
> org.apache.tuscany.das.rdb.impl.CommandImpl.<init>(CommandImpl.java:50)
>
> at
> org.apache.tuscany.das.rdb.impl.CommandImpl.<init>(CommandImpl.java:59)
>
> at
> org.apache.tuscany.das.rdb.impl.WriteCommandImpl.<init>(WriteCommandImpl.java:37)
>
> at
> org.apache.tuscany.das.rdb.impl.InsertCommandImpl.<init>(InsertCommandImpl.java:30)
>
> at org.apache.tuscany.das.rdb.impl.DASImpl.<init>(DASImpl.java:81)
>
> at org.apache.tuscany.das.rdb.impl.DASImpl.<init>(DASImpl.java:60)
>
> at
> org.apache.tuscany.das.rdb.impl.DASFactoryImpl.createDAS(DASFactoryImpl.java:31)
>
> DISCLAIMER:
> This e-mail is confidential for COSCO CONTAINER LINES (COSCON) and may also
> be privileged. Any unauthorized use, copying, or dissemination of it and any
> attachments to it, is prohibited. If you have received this e-mail in error,
> please delete it immediately, unread and notify the sender as soon as
> possible. COSCON does not warrant this email is virus-free and is not liable
> for any losses or responsibilities arising from any virus being transmitted
> by this email. Internet communications are not secure and COSCON does not
> accept legal responsibility for the contents of this message.
--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/
DISCLAIMER:
This e-mail is confidential for COSCO CONTAINER LINES (COSCON) and may also be
privileged. Any unauthorized use, copying, or dissemination of it and any
attachments to it, is prohibited. If you have received this e-mail in error,
please delete it immediately, unread and notify the sender as soon as possible.
COSCON does not warrant this email is virus-free and is not liable for any
losses or responsibilities arising from any virus being transmitted by this
email. Internet communications are not secure and COSCON does not accept legal
responsibility for the contents of this message.