Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Serializing & Deserializing objects through ObjectMessage

886634Sep 13 2011 — edited Sep 14 2011
Hi,

I'm having trouble sending objects/instances of a class (Data) through the message queue. I also made Data to be serializable.
public class Data implements Serializable {
...
}
The following are snippets of code from the Message producer side:
objectMessage = mySess.createObjectMessage();
MessageProducer myMsgProducer = mySess.createProducer(myQueue);
Data e = new Data();
objectMessage.setObject(e);
myMsgProducer.send(objectMessage);
And the following are snippets of code from the message consumer:
public void onMessage(Message message) {
...
             if(message instanceof ObjectMessage ){
	    try{
	    	ObjectMessage objMsg = (ObjectMessage) message;
	    	Data myData = (Data)objMsg.getObject();
	    }
	    catch(JMSException e){
	    	System.out.println("Exception occured: " + e.toString());
	    }
}
The result of attempting to cast the objMsg to a Data is an exception thrown.

i did noticed however, that when I was debugging the message consumer, that the byteArrayInputStream values for both message and objMsg are null meaning that the data is not being sent or received. Any help would be greatly appreciated, thanks!

Edited by: 883631 on Sep 13, 2011 4:09 PM

Edited by: EJP on 14/09/2011 09:22: added {noformat}
{noformat} tags. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

Comments

715399
Answer
Hi,

It looks like incremental inference is indeed being used. Note that there is some overhead involved with doing incremental and non-incremental inference in general, so even with small models it might take a few seconds to finish. Some of the overhead is caused by the large number of rules in the OWLPRIME rulebase, so if you don't need all of them you can selectively disable some components using the GraphOracleSem.performInference(String components) procedure.

Also, it depends on your dataset. For instance, if you're adding only one triple, but that triple declares some heavily used property to be transitive, then that addition might trigger many additional inferences and updating the inferred graph will take more time.

Regarding OntModel APIs and incremental inference, depends on the loading method you use. Incremental inference works best with incremental loading. Please refer to Section 2.2.9 of the Semantic Technologies Developer's Guide for more details.

Cheers,
Vladimir
Marked as Answer by 696067 · Sep 27 2020
696067
That is very strange. I am basically inserting 'd' into a 5-level-deep tree of Transitive links. The tree has around 5300 nodes but 5000 of them are leaves.
It takes 5 seconds for the inference to be done whether I insert one leaf like 'd' or 100 of them.
By doing a performInference with only SCOH, SPOH, and TRANS it goes down to 3 seconds (further removing TRANS goes down to 2 seconds but I absolutely need to use TRANS).

How come it takes the same 3-5 seconds to infer 5 transitive links and 500 of them?
715399
Hi,

Can you let us know:
a) how large is the asserted dataset and how many triples are generated with inference (from scratch) ?
b) what is the performance target for the incremental inference calls?

Regarding b), if your inference performance target is on the order of milliseconds, you might want to try out PelletDB [1].

Cheers,
Vlad

[1] http://clarkparsia.com/pelletdb/
696067
Thanks Vlad, it looks like in-memory forward-chaining is more of what I am looking for in this regard.
As to your questions:
1) I basically have a 5 level deep tree where every node is transitive to the root, with 5000 leaves and nodes of 200,100,30,1 respectively which to my understanding is 15530 transitive links.
2) My performance target is indeed in the milliseconds but that's when it comes to adding 1-50 leaves.

Thank you for your answers.
Alexi
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 12 2011
Added on Sep 13 2011
4 comments
1,711 views