[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
List in DSO  XML
Forum Index -> Terracotta Platform
Author Message
Admin

master

Joined: 05/24/2006 12:45:08
Messages: 71
Offline

am trying to test the clustering of List objects. So, I declared a List object as a shared root in my class and is trying to add some objects to the ArrayList. But, I get the following exception inspite of declaring a named write lock on add() method (or infact all the methods) of ArrayList....

Exception in thread "main" com.tc.object.tx.UnlockedSharedObjectException: Thread [main] has attempted to access a shared object (an instance of java.util.ArrayList) without first getting a shared lock. Please specifiy a lock for this access via your Terracotta configuration
at com.tc.object.tx.ClientTransactionManagerImpl.getTransaction(ClientTransactionManagerImpl.java:185)
at com.tc.object.tx.ClientTransactionManagerImpl.logicalInvoke(ClientTransactionManagerImpl.java:465)
at com.tc.object.TCObjectImpl.logicalInvoke(TCObjectImpl.java:261)
at com.tc.object.bytecode.ManagerImpl.logicalInvoke(ManagerImpl.java:390)
at com.tc.object.bytecode.ManagerUtil.logicalInvoke(ManagerUtil.java:70)
at java.util.ArrayList.add(ArrayList.java)

would this be because of TC using its own ArrayList as part of its instrumented classes???
Please help on what is causing this...

Thank You in advance
-stc
Admin

master

Joined: 05/24/2006 12:45:08
Messages: 71
Offline

stc,

Yes, the Java util classes are special cases that cannot be named locked. Instead of placing the write lock on the actual add method of the java.util.ArrayList class, put the lock on the methods that are calling the add().

Bill

_________________
Bill Chever
Product Support Manager
Terracotta, Inc.
 
Forum Index -> Terracotta Platform
Go to:   
Powered by JForum 2.1.7 © JForum Team