Skip to Main Content

Integration

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!

deserialize error JPA at LOB value

800028Feb 3 2011 — edited Feb 8 2011
Hi,

I have a strange error and i am looking for a solution since one week. I use oc4j and JPA and try to manage a one to many relationship. So I have two entities job and jobargument. The jobargument contains an LOB.
In the session bean I persist a job with argument. When I query for that job immediately, I get an deserialize error of the LOB, if I wait for at least one minute, no error occurs.

The JobEntity:
@Id
@Column(name = "JOB_ID", nullable = false)
@GeneratedValue(generator = "Car2x_JobSeq")
@SequenceGenerator(name = "Car2x_JobSeq", sequenceName = "CAR2X_JOB_SEQ",
allocationSize = 1)
private Long jobId;
@OneToMany(mappedBy = "jobEntity",
cascade = { CascadeType.PERSIST },
fetch = FetchType.EAGER)
private Collection<JobArgument> jobArgumentSet;


The JobArgument:
@Id
@Column(name = "FK_JOB_ID", nullable = false, insertable = false,
updatable = false)
private Long fkJobId;
@Id
@Column(name = "SEQUENCE", nullable = false)
private Long sequence;
@Lob
@Column(name = "CLOB_VALUE")
private Serializable clobValue;

@ManyToOne(cascade = { CascadeType.PERSIST },
fetch = FetchType.EAGER)
@JoinColumn(name = "FK_JOB_ID", referencedColumnName = "JOB_ID")
private JobEntity jobEntity;

Then I have a session bean where I persist a new jobs with jobargument:

job = (JobEntity) persistEntity (job);
job.addJobArgument(newArgument);
newArgument.setJobEntity(job);
newArgument = (JobArgument)persistEntity(newArgument);
job.getJobId();

And the error I get if i query for some jobs immediately is

Exception Description: Could not deserialize object from byte array.
Internal Exception: java.io.EOFException
Mapping: oracle.toplink.essentials.mappings.DirectToFieldMapping[clobValue-->CAR2X_JOB.CLOB_VALUE]
Descriptor: RelationalDescriptor(model.entities.JobEntity --> [DatabaseTable(CAR2X_JOB)]); nested exception is:
Exception [TOPLINK-66] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.DescriptorException

Because it´s a web application I can´t control when a query will be made or a new job is enqueued.

Any idea?
Any help welcome!

Bye kumaro
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2011
Added on Feb 3 2011
1 comment
1,519 views