More than JPA
Although Spring has specific support for EclipseLink JPA, you can also use EclipseLink MOXy with Spring Web Services and Remoting as a JAXB provider for XML message transformation. It doesn't require any special classes--it's all just configuration in your Spring application context XML. As I type this I find myself thinking "where is the how-to for that?" and I guess I'm on the hook now. Look out for a follow up on using EclipseLink MOXy with Spring!--Shaun
3 comments:
I was wondering whether 'MOXy' is able to deal with large XML files? >50MB
There are many aspects that make MOXy better suited for dealing with large XML files than other XML binding tools:
1. Unless you make use of the XML Binder (document preservation) feature then MOXy will not realize the XML document as a DOM. Many XML Binding tools always preseve the XML info set whether you need it or not.
2. There is no memory hit for unmapped content. The data in your XML document not mapped to your objects is never held onto in memory.
3. There is no intermediate data representation format. The memory foot print will be the size of the resulting object model.
Strategies:
1. Disable schema validation, by not validating memory will not be required to represent the XML Schema.
2. Use a more memory efficient parser. Unlike most XML binding tools MOXy uses standard JAXP parsers, simply plug your chosen one in and MOXy will use it.
3. Take advantage of MOXy's XPath based mappings. Other XML binding tools create an object per level of nesting which wastes memory.
-Blaise
I have posted an example of integrating Spring 2.5.6 with EclipseLink 1.1 here.
http://tinyurl.com/nnggx4
If anyone is interested.
Post a Comment