|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Generating INSERT statments to fileHi 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. |
|
|
Re: Generating INSERT statments to fileThere is no simple way to do this. Perhaps you can log an enhancement request.
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 database.
James Sutherland EclipseLink, TopLink Wiki: EclipseLink, TopLink Forums: TopLink, EclipseLink Book: Java Persistence |
|
|
RE: Generating INSERT statments to fileMy 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. Doug -----Original Message----- From: James Sutherland [mailto:jamesssss@...] Sent: Wednesday, June 18, 2008 10:08 AM To: eclipselink-users@... Subject: Re: [eclipselink-users] Generating INSERT statments to file There is no simple way to do this. Perhaps you can log an enhancement request. 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 database. 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. > ----- --- http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland http://www.eclipse.org/eclipselink/ EclipseLink , http://www.oracle.com/technology/products/ias/toplink/ TopLink Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink , http://wiki.oracle.com/page/TopLink TopLink Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , http://www.nabble.com/EclipseLink-f26430.html EclipseLink Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence -- View this message in context: http://www.nabble.com/Generating-INSERT-statments-to-file-tp17945602p17983511.html Sent from the EclipseLink - Users mailing list archive at Nabble.com. _______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users _______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users |
| Free embeddable forum powered by Nabble | Forum Help |