[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]
ChangeListeners and DMI  XML
Forum Index -> Terracotta Platform
Author Message
Admin

master

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

Hi,

I am trying to test the change listeners and DMI features of DSO.

I just created three roots of which root1 is List<obj1> and has distributed method. root2 is Collection<obj2> and has change listener and root3 is List<obj2>.

I declared the change listener only for root2 but not root3 in tc-config.xml.

Here are the issues which I am not clear of why they are happening:

1. When I add obj2 to root3, change listener is inovked ???

2. When I call the distributed method of root1 for the first time, change listener of obj2 is invoked and the below exception is thrown

com.tc.util.TCAssertionError: Assertion failed: No changes present
at com.tc.util.Assert.failure(Assert.java:39)
at com.tc.util.Assert.eval(Assert.java:48)
at com.tc.object.tx.ClientTransactionManagerImpl.fireChangeEvent(ClientTransactionManagerImpl.java:344)
at com.tc.object.tx.ClientTransactionManagerImpl.commit(ClientTransactionManagerImpl.java:252)
at com.tc.object.tx.ClientTransactionManagerImpl.commit(ClientTransactionManagerImpl.java:207)
at com.tc.object.event.DistributedMethodCallManagerImpl.commit(DistributedMethodCallManagerImpl.java:161)
at com.tc.object.event.DistributedMethodCallManagerImpl.distributedInvoke(DistributedMethodCallManagerImpl.java:92)
at com.tc.object.bytecode.ManagerImpl.distributedInvoke(ManagerImpl.java:463)
at com.tc.object.bytecode.ManagerImpl.distributedMethodCall(ManagerImpl.java:371)
at com.tc.object.bytecode.ManagerUtil.distributedMethodCall(ManagerUtil.java:74)

3. When I call the distributed method of root1 for the first time, change listener of obj2 is invoked 2/3 times before the actual distributed method is invoked ???

4. As per the TC Product Guide (page28) contract for root2 (declared as above), which is enabled as a change listener, my app should not call any methods other than the add and remove. If that is the case, how would I be able to change the objects already added to the Collection??? so that the changeListener method is invoked??? In trying to do this, when I iterated through the collection using the Iterator, TC doesnt throw any exceptions... If I understand correctly, when the contract says that the app should not call any other methods other than add() and remove() and the app is trying to call something else, then I guess that TC should through some sort of exception (UnSupportedOperationException)....

Any clarifications of the above questions would be greatly appreciated.

Thank You
- stc
Admin

master

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

stc,

We think that part of the problem you are encountering maybe a bug, but at this point we are not certain. There is also a question of how you are using the changeListener and DMI features.

Can I request you send the xml config file for this application, and if possible, a code example of what you are trying to accomplish?

You can send them directly to me rather than attaching them here.

wchever@terracottatech.com

Thanks!

_________________
Bill Chever
Product Support Manager
Terracotta, Inc.
Admin

master

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

tc,

Thanks for sending me your config file and your sample code. Looking at your config, you have specified the same field as both a root and a change listener. There's nothing specifically in the documentation about it, but that isn't supported. I'll request a documentation change to mention it.

The original intent of the change listener functionality was to allow a change listener to be notified of object changes so that business data in a database can be updated accordingly. From your sample code, it isn't immediately clear why you need to use either the change listener feature or the distributed method invocation feature-- unless you are just testing out these features.

Perhaps you could tell me a little more about what you are trying to accomplish with the change listener feature?

In general, the best way to use DSO is to write your application as if it were a plain multi-threaded application.

Let me go through your questions in detail:

Issue 1:

The answer to this question is that all of the change listener objects in the change listener collection are notified of every change that happens in the entire cluster.

Issue 2:

You have definitely exercised a bug in the change listener functionality. If a transaction is committed without any changes in it (which can happen if there are waits or notifies in the transaction but no object changes), the assertion error you cited will be thrown. We're working on a fix for it now.

Issue 3:

DSO uses distributed objects internally. Because all of the change listener objects are notified of every change, they will be notified of the DSO internal object changes as well as the user object changes.

Issue 4:

If I understand your question correctly, you want to be able to update the object that is also a change listener based on the contents of the change notification. You don't need to have a change listener for changes to distributed objects to propagate through the cluster. Again, if you could describe what you are looking to accomplish using the change listener, I might be of more assistance.

_________________
Bill Chever
Product Support Manager
Terracotta, Inc.
Admin

master

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

Bill,

Thank you for the above updates. I am basically trying to explore the features of DSO and see the extent of their flexibility.

Issue1: Not sure why all the change listeners are being notified of all the changes in cluster... wouldnt this result to more chattiness?? May be some sort of mapping between the objects in cluster and change listeners would be reasonable... or may be not if there is some other reason behind the actual functionality

Issue3: Again, I cant see a reason why DSO internal objects changes are being treated same as the user object changes? Would this be of any help? Would you please update on this.

Issue4: Yes Bill. I get the point that change listeners are not needed for the changes to roots to be propagated through the cluster. Again, as I said, I am just trying different things.

Thanks Again!!
 
Forum Index -> Terracotta Platform
Go to:   
Powered by JForum 2.1.7 © JForum Team