|
|
|
|||||
|
Freeze evictor synchronization with Java tie classes
Hi,
First, congratulations!! ICE is really a great software!! Simple and powerful!! Then my problem (certainly more a misunderstanding than a real bug...): I've read the documentation about the Freeze evictor and I need some details about its synchronization. I plan to use the tie classes to separate persistence data from interface implementation. On top of that, I also need implementation inheritance rather than interface inheritance. The Ice manual highlights the concurrency issue between the Freeze saving thread and the servant implementation, the solution consists in synchronizing the servant. But with the tie classes, this code is generated and I don't want to specialize the tie classes only to put the "synchronized" keyword. I've got a lot of functions and a lot of classes, and this job would be fastidious. So I'm wondering how to perform synchronization in a simple manner. My idea is that it would be useful to put an option on the slice2java command line. Any advice would be welcome! As examples are always clearer to understand, here is the sample of code: (I know that if I put the keyword "nonmutating" here, it would be OK, but I've got other functions that really modify the servant tie class, it's only an example, not the real code...) Root.ice module Inter { interface Root { int getID(); }; }; Entity.ice module Inter { interface Entity extends Root { int getClassID(); }; }; RootClass.ice module InterPersis { class RootClass implements Inter::Root { int ID; }; }; EntityClass.ice module InterPersis { class EntityClass extends RootClass implements Inter::Entity { int ClassID; }; }; RootImpl.java public class RootImpl extends _RootClassTie { public RootImpl() { super(); ice_delegate(new RootBehavior(this)); } } EntityImpl.java public class EntityImpl extends _EntityClassTie { public EntityImpl() { super(); ice_delegate(new EntityBehavior(this)); } } RootBehavior.java public class RootBehavior implements _RootOperations { private RootClass attributes; public RootBehavior(RootClass attr) { attributes = attr; } public int getID(Current __current) { return attributes.ID; } } EntityBehavior.java public class EntityBehavior extends RootBehavior implements _EntityOperations { private EntityClass attributes; public EntityBehavior(EntityClass attr) { super(attr); attributes = attr; } public int getClassID(Current __current) { return attributes.ClassID; } } Bye
__________________
Julien |
|
|||||
|
Hi Benoit,
I realize that my question was a bit silly! I've never wrote a single line of Java code, only C++, and I didn't know this syntax for the synchronized keyword. So, I really thank you for the reply and apologize for the wasted time. Bye
__________________
Julien |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Slow in Freeze Evictor add operation | Yunqiao Yin | Help Center | 2 | 02-06-2007 08:38 PM |
| Freeze Evictor Transactions | acbell | Help Center | 2 | 12-19-2005 12:43 PM |
| Identity Map for Freeze Evictor | acbell | Help Center | 4 | 09-01-2005 04:27 PM |
| Fast track Freeze evictor for RDBMS | StuartA | Comments | 0 | 05-23-2005 05:56 AM |
| evictor question | xdm | Help Center | 1 | 09-14-2003 02:11 AM |