openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kostellodon <>
Subject Oracle XMLType fetch problems
Date Fri, 25 Mar 2011 16:47:59 GMT
I am working with base WebSphere 7, which includes JPA 1.2.1, and am
interacting with an Oracle 11.2 database.  I have a table with an XMLType
column in it that I am trying to persist and later retrieve from.  I am
doing my testing using JUnit 4, using ojdbc6. for my driver. 
My classes are being enhanced at loadtime using the javaagent.

I have tried 2 different methods to store and retrieve the xmltype column. 
My first class uses a simple String attribute, and looks like this
(BasicEntity just contains versioning and user info):

public class ServiceSnapshot extends BasicEntity {
	private static final long serialVersionUID = 5789621189247103676L;

sequenceName="SERVICE_SNAPSHOTS_SEQ", allocationSize=1)
	private Long id;

	private String serviceCode;

	private String operationCode;

	private String contentsXML;

When I persist the objects, things appear to be stored in the database as
expected.  If I store and fetch the objects in the same method (so that the
objects are in the entity manager), everything comes back fine.  I can query
the database via SQL and the results are returned.  However, if I just fetch
the objects, all of the attributes except the XML attribute are properly
fetched.  The XML attribute is null.  If I log the SQL that's being run, I
see the column in the SQL string, but the contentsXML is still null.

My second uses a JAX-B enhanced object to replace the contentsXML attribute,
and this attribute looks like this:
	private DEServiceResults results;

I get the same behavior with this class - the results attribute is null,
even though the other attributes are not, and results is in the SQL query
that gets logged.

I can fetch the xml if I use a native query, so I don't think it's a driver
issue.  Am I setting up my xmltype incorrectly, is this an OpenJPA problem,
or is this a bug with the IBM version?

Thanks for any help.


View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message