AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

checking object deletion

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and CORBA
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Wed Jan 17, 2007 9:38 pm    Post subject: checking object deletion Reply with quote



Hi,

I'm writing a Java CORBA client, and am using the following code to
check if a pair of remote object references are still valid:

try {

if (workOrderInterface._non_existent() ||
eventFilterInterface._non_existent()) {
doSessionRefresh();
}
} catch (RuntimeException rex) {

//
// The _non_existent() calls above may have been throwing
NullPointerExceptions
// This handler should ensure that if anything unexpected happens,
we'll forcibly
// refresh the session
//
LOG.error("Error checking session validity. Session will be
forcibly refreshed", rex);
doSessionRefresh();
}

I added the try-catch, because _non_existent() was throwing a
NullPointerException. The evidence was provided by the following stack
trace I found in my logs:

Caused by: java.lang.NullPointerException
at com.inprise.vbroker.orb.ORB.getThreadLocalObject(Unknown Source)
at com.inprise.vbroker.qos.PolicyHelper.get_client_policy(Unknown
Source)
at com.inprise.vbroker.orb.DelegateImpl.get_policy(Unknown Source)
at org.omg.CORBA.portable.ObjectImpl._get_policy(ObjectImpl.java:310)
at com.inprise.vbroker.GIOP.ProtocolConnector.doServiceContext(Unknown
Source)
at com.inprise.vbroker.GIOP.ProtocolConnector.doServiceContext(Unknown
Source)
at com.inprise.vbroker.IIOP.ProtocolConnector.doServiceContext(Unknown
Source)
at com.inprise.vbroker.GIOP.ProtocolConnector.request(Unknown Source)
at com.inprise.vbroker.GIOP.ProtocolConnector.pseudoRequest(Unknown
Source)
at com.inprise.vbroker.GIOP.ProtocolConnector.non_existent(Unknown
Source)
at com.inprise.vbroker.orb.DelegateImpl.non_existent(Unknown Source)
at
org.omg.CORBA.portable.ObjectImpl._non_existent(ObjectImpl.java:137)
at
com.acecomm.parentpatrol.surePay.SurePaySession.refreshSessionIfNecessary(SurePaySession.java:335)

Anyway, my question is this.....is there a better way to check whether
a remote object reference is still valid? Preferably, one which doesn't
throw any runtime exceptions Smile

Thanks in Advance,
DM
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and CORBA All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.