Monday May 03, 2010

Low Latency Scheduling with Oracle Coherence

I have been too caught up with my transition to Oracle, so have not been able to spend much time in writing my blog. As I'm now a part of Oracle, I have been spending some of my free time getting familiar with Oracle products, in particularly Oracle Coherence.

Coherence provides distributed data memory, something like a shared memory space across multiple systems. Existing similar competing products are Gigaspaces, Gemfire and Terracotta. Coherence is extremely versatile and can be use for different purpose, e.g. with application servers to scale your web application, in financial trading for low latency transaction processing and high performance data intensive computing.

Coherence provides a way for low-latency scheduling of small independent tasks. Traditional HPC job schedulers like Grid Engine schedules jobs in a fixed interval (usually in several seconds), it is fine for jobs that run for a few hours but not for many small tasks that needs to be processed quickly. One way that Coherence is able to address this is to use the WorkManager interface.
[Read More]

Friday Aug 01, 2008

Serializing to XML using JAXP DOM API

I was writing some Java codes to process some XML data and encountered an annoying problem which took me a while to fix. I want to put this down here in my blog in case I forget.

I'm using JAXP API to parse my XML to DOM, I then need to extract a sub-element and serialize it back to XML as string. It is working fine when run as a standalone application, but when I used the code in a servlet deployed in Tomcat I got "Provider org.apache.xalan.processor.TransformerFactoryImpl not found" exception. Initially I thought that maybe I'm missing my xalan.jar but then after googling I find a suggestion to set the system property to use another TransformerFactory implementation:


System.setProperty("javax.xml.transform.TransformerFactory",
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");

Oh if any people out there are wondering how to get rid of the XML declaration header:
when serializing to XML, just set the output property.


DOMSource domSource = new DOMSource(xmldom);
StreamResult streamResult = new StreamResult(System.out); // print xml to stdout
TransformerFactory tf = TransformerFactory.newInstance();
Transformer serializer = tf.newTransformer();
serializer.setOutputProperty(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
serializer.transform(domSource, streamResult);

About

Melvin Koh

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today