Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-users] Generating INSERT statments to file

My rough idea on this one was to use a SessionEventListener in conjunction with query redirectors to write the SQL (without parameter binding) to a file instead of the database.

One challenge is the behaviour of the transaction with respect to the cache. If we intercept the writes and log them the runtime will assume the writes were successful and then will merge the new instances into the cache. I believe this approach in conjunction with isolated caching for the types in question should address this side but wanted to post the idea for additional feedback.


-----Original Message-----
From: James Sutherland [mailto:jamesssss@xxxxxxxxx]
Sent: Wednesday, June 18, 2008 10:08 AM
To: eclipselink-users@xxxxxxxxxxx
Subject: Re: [eclipselink-users] Generating INSERT statments to file

There is no simple way to do this.  Perhaps you can log an enhancement

You could do this by creating your own EclipseLink SessionLog to capture the
SQL, and create your own fake JDBC Connection to not access the database (I
think we even have one in testing somewhere).  One of the issues will be
reading objects and generating sequence numbers, as these need to access the

rgn wrote:
> Hi All,
> We're currently using EclipseLink and working on migration data.
> We're trying to find out if it is even possible to have EclipseLink
> generate
> the INSERT statement for us and store it to a file without persisting to
> any
> database?
> So we want just to capture all the insert statements and put it in a file
> and use it later.
> We're using the Classic API and the case is for new objects and write
> only.

--- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

eclipselink-users mailing list

Back to the top