Bugs item #747143, was opened at 2003-06-01 23:57 Message generated for change (Comment added) made by loubyansky You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=747143&group_id=22866
Category: JBossCMP Group: v3.2 Status: Open >Resolution: Accepted Priority: 7 Submitted By: Andrew Veliath (andrewtv) >Assigned to: Alexey Loubyansky (loubyansky) Summary: CMR exception when many threads get 1-side from N-side Initial Comment: OS: Linux JDK: 1.4.0_04 We have experienced a new exception going from 3.2.0RC1 to 3.2.1 regarding CMR's under load (with MySQL and InnoDB). Here is the scenario: there are 2 EJB 2.0 beans using CMR, Partition and StationGroup (there are many more, but use these two for example). There is a 1-N relation from Partition to StationGroup, and there is some code that retrieves the PartitionLocal from the station group side (i.e. retrieving the 1-side local intf from the N-side intf). All methods in Partition and StationGroup have the "Required" trans-attribute, and non are marked read-only. Note this problem does not occur in 3.2.0RC1, but in 3.2.1 it appears to happen in about 1/500 cases under moderate load. Since it is hard to reproduce it sounds like some sort of race or synchronization issue. The problem appears to happen here--it seems that doing "partLocal = sg.getPartition()" (N-side retrieving 1-side local) to retrieve the PartitionLocal seems to lock and load the entire Partition bean, however it does not appear to lock Partition properly and multiple threads that call sg.getPartition can somehow interfere with each other (i.e. many N-side threads call get1Side()), causing JDBCCMRFieldBridge.FieldState to be invalidate()d and the other threads calling sg.getPartition() from different StationGroups will start throwing NPEs (in loadRelations typically since setHandle[0] is then null I assume), ConcurrentModificationExceptions, etc. This is sort of the *opposite* test of the current CMRStressTestCase (many N-side threads getting the 1-side, instead of many threads getting the N-side from the 1-side), and the only difference is that our get methods are not marked as read-only at the moment. I agree a test case will help for this. ---------------------------------------------------------------------- >Comment By: Alexey Loubyansky (loubyansky) Date: 2003-06-09 13:21 Message: Logged In: YES user_id=543482 Could you, please, try again with current Branch_3_2 from CVS? Thanks, alex ---------------------------------------------------------------------- Comment By: Andrew Veliath (andrewtv) Date: 2003-06-08 20:54 Message: Logged In: YES user_id=751757 More testing with JBoss tag 3.2.2RC1 resulted in a NPE in getRelatedEntityByFK in exc3.txt. Scenario: beans Partition, User, and Station. PartitionLocal (1) <-> StationLocal (N), and PartitionLocal (1) <-> UserLocal (N) where station.getPartition() and user.getPartition() get called from many threads in many child beans. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=747143&group_id=22866 ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development