users@glassfish.java.net

EclipseLink - that's a little more information than I needed (in the log..)

From: <glassfish_at_javadesktop.org>
Date: Mon, 24 May 2010 09:22:00 PDT

I've got a unique constraint on a couple of columns in a MySQL table which is accessed by a JSF/EJB/JPA app. When a user hits the constraint I detect the (soft) error and they get a nice little message on the screen to advise them on
the error of their ways. What I'd like to do is to stop the vast amounts of output
written to the server log for obvious reasons, I won't be able to spot the real
problems from the "normal operation" situations. I'm aware of the log levels in
admin console but would appreciate any advice on what exactly needs to be
changed to get this under control.

Thanks,
Brendan.

Here is just a mere few lines of output:

WARNING: Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'James-Healey' for key 'UNQ_players_0'
Error Code: 1062
Call: INSERT INTO players (email, dob, lastname, firstname, photo, birthcertificate, version, user) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
        bind => [james_at_james.com, 1998-08-12, Healey, James, null, null, 1, 1]
Query: InsertObjectQuery(uk.co.sportquest.entities.Player[id=null])
        at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:800)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:866)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:586)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:529)
        at org.eclipse.persistence.internal.sessions.AbstractSession.executeCall(AbstractSession.java:914)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:205)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:191)
        at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:334)
        at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:162)
        at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:177)
        at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:461)
[Message sent by forum member 'healeyb']

http://forums.java.net/jive/thread.jspa?messageID=471223