Skip to main content

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

8 replies [Last post]
healeyb
Offline
Joined: 2010-01-26

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@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 was edited by: healeyb

Message was edited by: healeyb

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
healeyb
Offline
Joined: 2010-01-26

Thanks for the helpful comments. I set a breakpoint [i]after[/i] the commit in the
EJB routine that called EntityManager.persist(). I could go into an external
query tool and see that the version and update time of the row had been
updated.

Then, step through the code and run a named query which re-queries the
database and is outside the context of any merged or detached entity instances
and, oddly enough, the version has been updated to the latest but the updated
time of the same row is stale.

No doubt a bug. I even tried calling EntityManager.find() to ensure that there
was no flush context problems occurring, but this made no difference. I've
gone back to basics on this now.

Thanks,
Brendan.

healeyb
Offline
Joined: 2010-01-26

Hi, the problem is that no matter how much wrapping of calls you do with try
catch blocks it does not affect what is written to the log. I tried changing the
ejb & jta log level settings to severe and now I just get the log output shown
below. The use of unique constraints is effectively made unusable because of
this problem and it needs to get fixed. The use of log errors should be for hard
errors like "the database server has not been started" or "there is a bug in the
code" not because a user has tried to enter two "John Doe" entries in a list.

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@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)
at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80)
at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90)
at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:286)
at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:675)
at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:589)
at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:109)
at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:86)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2863)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1225)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1207)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1167)
at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:197)
at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:103)
at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3260)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1405)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:547)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithPreBuiltChangeSet(UnitOfWorkImpl.java:1551)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:360)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:696)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.flush(EntityManagerWrapper.java:407)
at uk.co.sportquest.ejb.PlayerFacade.create(PlayerFacade.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
at $Proxy108.create(Unknown Source)
at uk.co.sportquest.ejb.__EJB31_Generated__PlayerFacade__Intf____Bean__.create(Unknown Source)
at uk.co.sportquest.jsfbeans.PlayerView.createPlayer(PlayerView.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:234)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'James-Healey' for key 'UNQ_players_0'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2019)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1937)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1922)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:791)
... 98 more

mvatkina
Offline
Joined: 2005-04-04

You can check for possible constraint violations in your code, then there will be no SQL exception at all (or in most cases). And your application might even work faster (exceptions are expensive).

-marina

Bobby Bissett

On May 27, 2010, at 4:41 PM, glassfish@javadesktop.org wrote:
> You can check for possible constraint violations in your code, then
> there will be no SQL exception at all (or in most cases). And your
> application might even work faster (exceptions are expensive).

Only with pessimistic locking, right? Otherwise, a different
transaction could commit a change before the constraint-violation-
checking transaction commits. I do what the original poster does --
let the DB tell me if there's an issue at the DB level.

Cheers,
Bobby

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

gamliela
Offline
Joined: 2009-08-13

I guess you have some functions that manipulates the calls to the database.
You can wrap the calls to these functions with try-catch block and intercept all javax.persistence.PersistenceException.
If you need more specific data on the nature of the problem, I believe you can look at the cause and cast the underlying exception to some EclipseLink object.
Then, you can decide whether to report something to the log or just print nice message to the user.

Bobby Bissett

> 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.

When I try it, it looks like the same exception is being logged by two
different loggers -- double your fun. Maybe there's some general
property that makes this info less verbose, but you can turn it off by
setting the log level for these to SEVERE in the admin console (don't
forget to click Save after you set them):

javax.enterprise.resource.jta
javax.enterprise.system.container.ejb

Reminder: v3 in admin console, Logger Settings are under Configuration
in the left hand pane.

Cheers,
Bobby

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

healeyb
Offline
Joined: 2010-01-26

Thanks for your reply Martin, the thing is I'm using the JPA EntityManager to
perform my queries (using container managed persistence) and all the output is being written to the glassfish v3 server log by the persistence implementation/
web and/or ejb container, so I don't know if the suggested approach will work.

Presumably there must be a solution to this for production environments, I can
switch all the log levels off but as I'm developing at present it's not a sensible
approach.

I'm using a "logging application exception handler" which can handle chained
exceptions and it tells me everything I want to know about any exception that
occurs, in about 4-10 lines out log output, so I don't need the additional 300 lines
of stack trace that's getting spewed out.

Thanks,
Brendan.

Martin Gainty

the easiest way is to create a control which will be dynamically populated from the contents of the response

try
{
String sql_str=null;
sql_str=new String("INSERT INTO "+table+" VALUES('"+

")" );
}
insert_stmt = beginSimpleTransaction(sql_str);
if((response_string!=null)&&(insert_stmt==null) )
{
return "Jake Blues";
}
insert_stmt.execute();
}
catch ( java.sql.SQLException sqle )
{
if((sqle.getMessage().indexOf("PK")!=-1)||(sqle.getMessage().indexOf("Duplicate entry")!=-1))
{
insert_stmt.close();
conn.close(); //Close the insert handle
String return_from_update_response=null;
try
{ // we should be updating the record
return_from_update_response=updateSubmitWriType2(request,table,UNIQUE_ID,SOURCE,DESTINATION,TIMESTAMP,LOC_STATION,LOCATION_STATE,WRIMODE,TRIGGERTYPE,ENCRYPTSCHEME,DECRYPTSCHEME,MESSAGETYPE,CAR_USDOT_NO,IIT_CAR_NAME,TT_ID,TT_JURIS,TT_SELC,MDRIVER_LNAME,MDRIVER_FNAME,MDRIVER_PINID,MDRIVER_SDN,MDRIVER_24HRS,MDRIVER_MBU,CODRIVER_LNAME,CODRIVER_FNAME,CODRIVER_PINID,CODRIVER_SDN,CODRIVER_24HRS,CODRIVER_MBU,VT_GCW,VT_LIGHTING,VT_SFTY_BELT,TRANSPONDER_ID,ENCOUNTER_LAT,ENCOUNTER_LONG,GLOBALQUERYTYPE);
}
catch(Exception update_exception)
{
return "Jake Blues";
}

the next time mr healey's record is inserted you will see the error message "..Jake Blues.."

the SQLException allows us to either use SQLException.getMessage() or a custom message
the contents of the message are written by HttpServletResponse to the client
the client can then display those contents dynamically in a div tag or in any tag with jsp as I have done here in a td my jsp

<%=axiomclient.get_response_string()%>

 

this is a abbreivated form of what is currently implemented in code.. feel free to ping me offline for details
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

> Date: Mon, 24 May 2010 09:22:00 -0700
> From: glassfish@javadesktop.org
> To: users@glassfish.dev.java.net
> Subject: EclipseLink - that's a little more information than I needed (in the log..)
>
> 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@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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:...
[att1.html]