Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7668989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:29:42+00:00 2026-05-31T15:29:42+00:00

I am creating an application with eclipselink JPA, I am using HistoryPlicy to create

  • 0

I am creating an application with eclipselink JPA, I am using HistoryPlicy to create historical data. Every thing is working fine, but I am facing a problem with copying blob data to history table.

@Entity
@Customizer(AttachmentHistoryPolicy.class)
@Table(name = "STAFF_ATTACHMENT", catalog = "", schema = "OIA")
public class Attachment implements Serializable {
    @Id
    private Long id;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Column(name = "CONTENTS")
    private byte[] contents;

    // getters and setters
}


public class AttachmentHistoryPolicy implements DescriptorCustomizer {

    @Override
    public void customize(ClassDescriptor cd) throws Exception {
        HistoryPolicy policy = new HistoryPolicy();
        policy.addHistoryTableName("HIST_STAFF_ATTACHMENT");
        policy.addStartFieldName("HIST_START_DATE");
        policy.addEndFieldName("HIST_END_DATE");
        policy.setShouldHandleWrites(true);
        //policy.useDatabaseTime();
        cd.setHistoryPolicy(policy);
    }

}

the row is inserted in the history table, but with empty blob!!!

is there a way to handle this using eclipselink HistoryPolicy ?

EDIT:

following are the sql statements generated by eclipselink

BEGIN INSERT INTO OIA.STAFF_ATTACHMENT (ID, CONTENT_TYPE, CONTENTS, FILE_NAME, FILE_SIZE, OWNER, STAFF_MEMBER) VALUES (?, ?, ?, ?, ?, ?, ?) RETURNING CONTENTS INTO ?; END;

SELECT CONTENTS FROM OIA.STAFF_ATTACHMENT WHERE (ID = ?) FOR UPDATE

INSERT INTO HIST_STAFF_ATTACHMENT (ID, CONTENT_TYPE, CONTENTS, FILE_NAME, FILE_SIZE, OWNER, STAFF_MEMBER, HIST_START_DATE) VALUES (?, ?, ?, ?, ?, ?, ?, ?)

SELECT CONTENTS FROM OIA.STAFF_ATTACHMENT WHERE (ID = ?) FOR UPDATE
bind => [1 parameter bound]

note the tow identical statements for select contents for update (the two statements are for STAFF_ATTACHMENT table)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:29:43+00:00Added an answer on May 31, 2026 at 3:29 pm

    Seems to be an issue with EclipseLink’s support for history in combination of LOB locator support for Oracle platforms.

    Please log a bug, but if you are using Oracle 11, then I think LOB now work without a locator, so the workaround is no longer required. Try setting the platform to Oracle11, or just use OraclePlatform which does not use the locator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating application in cocos2d, but one thing I would like to know
Im creating application in java using XML. XML- <?xml version=1.0 encoding=UTF-8?> <songlist id=slist> <song
I am creating an application where a user can create a document and upload
I am creating application for MAC using cocoa framework, I would like to know
I am creating application in facebook using iframe. In that i want to redirect
I am creating application that simply reads data from an XML file and displays
Possible Duplicate: How can I create a multilingual android application? I am creating application
I am new in creating application using Visual Studio 2010 and Microsoft Access 2007.
I'm looking for an introduction in creating application using CodeIgniter and Integrating it to
I'm creating application with OptionsMenu . I found few examples with it, but everyone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.