Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Programmatically obtain SQL statements emitted by EclipseLink(Programmatically obtain SQL statements emitted by EclipseLink 2.0)
Programmatically obtain SQL statements emitted by EclipseLink [message #653989] Sat, 12 February 2011 10:16 Go to next message
Doug Gschwind is currently offline Doug Gschwind
Messages: 18
Registered: July 2009
Junior Member
Hello,

I am using EclipseLink 2.0 and trying to determine solutions for programmatically obtaining the SQL statements that are emitted by EclipseLink to be executed by the database. Ideally, the solution would work regardless of SQL logging level, as well as regardless if a JP QL, native query, named query, native named query, stored procedure, etc. was invoked via EclipseLink.

I found the following thread where James weighed in and described one solution :

http://www.eclipse.org/forums/index.php?t=tree&th=125713 &#page_top

I am wondering if there are alternatives (e.g. listeners, AOP) that would lend itself to a more general and once and only once solution that would allow me to obtain the SQL String emitted to the database by EclipseLink, irrespective of the means to get to that point.

Any ideas would be appreciated.

Thank you,

Doug Gschwind
Re: Programmatically obtain SQL statements emitted by EclipseLink [message #691905 is a reply to message #653989] Sat, 02 July 2011 15:07 Go to previous message
Rolf Paulsen is currently offline Rolf Paulsen
Messages: 14
Registered: June 2010
Junior Member
Hi,
you could try a SessionEventListener, e.g. preExecuteQuery(), and get the Query from the event or session.
Regards
Rolf
(no subject) [message #691921 is a reply to message #653989] Sat, 02 July 2011 15:07 Go to previous message
Rolf Paulsen is currently offline Rolf Paulsen
Messages: 14
Registered: June 2010
Junior Member
Hi,
you could try a SessionEventListener, e.g. preExecuteQuery(), and get the Query from the event or session.
Regards
Rolf
Previous Topic:(no subject)
Next Topic:ManyToMany mapping leads to duplicate entry error in join table, why is it?
Goto Forum:
  


Current Time: Mon Apr 21 03:09:59 EDT 2014

Powered by FUDForum. Page generated in 0.04458 seconds