I'm having difficulty in my application with allowing multiple threaded access in the create method. Is it possible to specify that if one is testing my create method in a multi-threaded environment, that the currentThread.join() within the threading code application must be invoked? Would this be allowed or not or could it be a failure issue? Thanks.
Mark O' Sullivan
Joined: Aug 17, 2009
Apologises have solved this issue. I wrote a multi-threaded application to test my create method, did the usual, created a private class to simulate a thread instance. But I also needed to test multiple instances of the application. But i created the instances of the application within the private thread class instead of top of the testing class. This lead to some unusual problems such as a create record being created 3 times with the same name. I'm new to multi-threading applications but I'll learn from this mistake, believe me. Thanks for help!
Glad you solved your issue. And to confirm: if you have to use things like currentThread.join() you are on the wrong track. The only things I needed to make my Data class thread-safe are synchronized, wait and notifyAll.