Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-31-2005
acbell acbell is offline
Registered User
 
Name: Andrew Bell
Organization: Iowa State University
Project: National Resources Inventory
 
Join Date: Jan 2005
Location: Ames, IA, USA
Posts: 89
Identity Map for Freeze Evictor

Hi,

I assume that freeze has a way to find an object from its identity (hasObject() does this, but doesn't return the object, just a bool). I also assume that this is the primary key for Berkeley.

Can I "find" on this index, to return an object based on its identity? I'd hate to create a second index if you already have one created just for this purpose. Perhaps I have just missed something in the documentation -- wouldn't be the first time.

Thanks In Advance,

-- Andrew Bell
andrew.bell.ia@gmail.com
Reply With Quote
  #2 (permalink)  
Old 08-31-2005
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
Hi Andrew,

The Freeze Evictor has no find() or lookup() operation because the returned object could be evicted from the evictor cache at any time.

You can use locate()/finished() on the Evictor (a ServantLocator) to load/grab and later release an object given its identity; to do so, you just need to manufacture a proper Current.

Of course, if you just need to access an object through its Slice-interface, manufacturing a proxy and calling on this proxy is much simpler.

Best regards,
Bernard
Reply With Quote
  #3 (permalink)  
Old 09-01-2005
acbell acbell is offline
Registered User
 
Name: Andrew Bell
Organization: Iowa State University
Project: National Resources Inventory
 
Join Date: Jan 2005
Location: Ames, IA, USA
Posts: 89
locate() and the ASM

Thanks for the info. I wasn't thinking through the whole chain of events.
Quote:
You can use locate()/finished() on the Evictor (a ServantLocator) to load/grab and later release an object given its identity; to do so, you just need to manufacture a proper Current.
The documentation says that a check is made in the ASM for the object and only calls locate() if the object isn't in the ASM. Is it an error to call locate() for an object that already has a servant? It looked to me like the code the EvictorI::locate() calls Cache::pin(), which will check the Cache::_map and return the servant from there if it exists, but I wanted to check just to be sure.
Quote:
Of course, if you just need to access an object through its Slice-interface, manufacturing a proxy and calling on this proxy is much simpler.
On the idea of just calling createProxy() on the identity and then making a call, is the marshall/unmarshall stuff small enough overhead that I should ignore it and, as you say, do it the easy way? It just seems unfortunate to have to go through that on the server when I've already got everything needed to perform the operation other than the assurance that the object is resident.

Thanks as always,

-- Andrew Bell
andrew.bell.ia@gmail.com
Reply With Quote
  #4 (permalink)  
Old 09-01-2005
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Quote:
Originally Posted by acbell
On the idea of just calling createProxy() on the identity and then making a call, is the marshall/unmarshall stuff small enough overhead that I should ignore it and, as you say, do it the easy way? It just seems unfortunate to have to go through that on the server when I've already got everything needed to perform the operation other than the assurance that the object is resident.
If you do not explicitly disable collocation optimization, there will be no marshaling or unmarshaling. Please see the Ice manual, Chapter "29.17 Location Transparency", for further details.
Reply With Quote
  #5 (permalink)  
Old 09-01-2005
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 816
Hi Andrew,

Quote:
Originally Posted by acbell
The documentation says that a check is made in the ASM for the object and only calls locate() if the object isn't in the ASM.
Correct.

Quote:
Is it an error to call locate() for an object that already has a servant? It looked to me like the code the EvictorI::locate() calls Cache:in(), which will check the Cache::_map and return the servant from there if it exists, but I wanted to check just to be sure.
The ASM and Cache::_map are unrelated maps. Remember that Ice does not insert the located servant in the ASM. And the implementation of the Freeze Evictor does not use the ASM at all -- you can call locate() for any object.

Quote:
On the idea of just calling createProxy() on the identity and then making a call, is the marshall/unmarshall stuff small enough overhead that I should ignore it and, as you say, do it the easy way?
If your caller and servant are collocated (share the same communicator), by default the call is optimized: there is no marshalling or unmarshalling.

Cheers,
Bernard
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 synchronization with Java tie classes jdekozak Help Center 2 01-30-2007 02:12 PM
\ in Identity DeepDiver Help Center 3 02-16-2006 01:13 AM
Freeze Evictor Transactions acbell Help Center 2 12-19-2005 12:43 PM
Fast track Freeze evictor for RDBMS StuartA Comments 0 05-23-2005 05:56 AM


All times are GMT -4. The time now is 11:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.