Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-25-2008
dmitry.medvedev's Avatar
dmitry.medvedev dmitry.medvedev is offline
Registered User
 
Name: Dmitry Medvedev
Organization: Kaspersky Lab, ZAO
Project: Kaspersky KnowledgeBase
 
Join Date: Sep 2005
Location: Moscow
Posts: 23
Send a message via ICQ to dmitry.medvedev
-->
Singleton object for services in an IceBox

Hi.
According to the MVC paradigm I have decided to establish a special IceBox responsible for hosting services dealing with database operations. Lets name it DataBaseBox.

Other services, when they will manipulate data in a database, communicate with their counterparts hosted in the DataBaseBox.

E.g.: lets assume we are to create an Logger service. The service should be able to store log entries in a database. I suggest creating actually two services:
1. Logger service which is accessible to clients;
2. LoggerDAL service which is accessible to only other services and which resides in the DataBaseBox.

When a client invokes the Logger.write(log_entry) operation the Logger service sends the log_entry to the LoggerDAL service.

The LoggerDAL service uses the NHibernate to actually access the underlying database for data manipulations.

The problem: I need to establish the NHibernate as a singleton object accessible to all the services hosted by the DataBaseBox. Having this in hand is a must when it is required to issue JOIN operations in the underlying database.

Any thoughts?

Regards,
Dmitry.
__________________
Dmitry N. Medvedev
Kaspersky Lab
http://www.kaspersky.com/
Kaspersky KnowledgeBase
Reply With Quote
  #2 (permalink)  
Old 09-25-2008
matthew's Avatar
matthew matthew is online now
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,088
Quote:
The problem: I need to establish the NHibernate as a singleton object accessible to all the services hosted by the DataBaseBox. Having this in hand is a must when it is required to issue JOIN operations in the underlying database.
I would have some static singleton, lazy initialized by the first caller. You can put this in some shared library linked by all the services.
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
invocation between two services in the IceBox drumnbass Help Center 3 03-05-2008 07:32 AM
IceBox Determining Dependent Services Sameerrele Help Center 2 09-25-2006 01:59 PM
IceBox hosting java services in IceGrid Sameerrele Help Center 5 08-21-2006 11:56 AM
Purify and IceBox services xdm Help Center 4 06-07-2006 04:59 PM
Share endpoint between services in IceBox rspivak Help Center 2 04-14-2006 07:18 AM


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


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