[omniORB] OBJECT_NOT_EXIST ???

Storm,Ole OLS ols@kmd.dk
Fri, 3 Nov 2000 11:15:27 +0100


Hi fellow omniORB'ers,

We are using omniORB2.8 in a setup where one server (Win 2000 Service) =
is
used by multiple distributed clients processes (Windows 95/98/NT/2000
Application). Each client communicates with its own dedicated server =
object,
which is dynamically created when the client logs on to the server =
process.
These server objects are then destroyed when the client signs of, or
automatically garbage-collected by the server if the clent process is
otherwise terminated (the client ping's its object on a regular basis =
to
keep it alive).

Recently we have implemented a broadcast utility, such that the server =
is
able to broadcast messages to all clients. However, after having added =
this
broadcast utility, we are experiencing some client processes =
ocationally
recieving the OBJECT_NOT_EXIST exception.=20
It seems that somehow the clients server object has been released from =
the
ORB, and we can't figure out why!


Our interface looks like this:

interface ServerObject
{
	...
	string get_broadcast_message();
	void ping();
	...
}

The get_broadcast_message() method is implemented as a 'hanging call', =
to
avoid clients polling for messages. When a broadcast message is =
available
the event object of every server object is signalled to wake up the =
thread
in the 'hanging call'. The thread uses a timed wait on the event =
object, to
avoid problems if the CORBA call is timed out. In our code we make sure =
that
BROADCAST_TIMEOUT < omniORB::callTimeOutPeriod(...)

The server implementation looks like this:

char*  ServerObject_i::get_broadcast_message()
	// Returns the first available broadcast message.
{
	try{
		if(m_bc_messages.size() =3D=3D 0)
			WaitForSingleObject(m_bc_event, BROADCAST_TIMEOUT);
		std::string msg =3D "";
		if(m_bc_messages.size() > 0){
			msg =3D m_bc_messages.front();
			m_bc_messages.pop_front();
		}
		return CORBA::string_dup(msg.c_str());
	}
	catch(...)
	{ }
	return CORBA::string_dup("");
}

- while the client code calling get_broadcast_message() looks like:

static DWORD WINAPI broadcast_handler_thread( LPVOID lpParameter )
{
	while( true )
	{
		try
		{
			std::string s =3D _wc()->get_broadcast_message();
			if (s !=3D "")
			{
				::MessageBox(frame_hWnd, s.c_str(),
"Broadcast Message", MB_ICONINFORMATION | MB_SYSTEMMODAL);
			}
		}
		catch(...)
		{
		}
	}
}
- running in its own thread.


Is there anything in this set-up (the hanging calls for instance) that =
could
cause troubles?? We are somehow suspecting the calls to the ping() =
method -
maybe they fail to reach the server object, which is then timed out!!

We have recently upgraded from omniORB 2.7 to omniORB 2.8. For that =
reason
we will ocationally have a client based on omniORB 2.7 running on the =
same
machine as a client based on 2.8. Can this be a problem???



Best regards,

	Ole.

> Ole Storm, ols@kmd.dk
> Udvikler, PUI
> KMD A/S
> Niels Bohrs Alle 185
> 5220 Odense S=D8
> Tlf  44 60 52 83
>=20
>=20
>=20