users@glassfish.java.net

MySQLIntegrityConstraintViolationException - on load...any suggestion??

From: <glassfish_at_javadesktop.org>
Date: Thu, 01 Nov 2007 22:58:55 PST

Hi ,

I am using glassfish Build b58g-fcs (09/07/2007) and MYSQL 5.0.22 on Linux. (P4 - 2GB RAM). For this entity I am using annotation to generate ID/primary key automatically:

@GeneratedValue(generator="top_name_tab")
    @TableGenerator(name="top_name_tab", table="ID_AS", pkColumnName="ID_NAME",
        valueColumnName="ID_VAL", pkColumnValue="TOP_NAME_ID", allocationSize=1)

When number of concurrent user is low, it works fine. But when number of concurrent user increase I get the following exception. Any suggestion/comments would be appreciated.

Thanks.

EXCEPTION
==========
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '231285' for key 1
Error Code: 1062
Call: INSERT INTO top_name (id, name, ex_port, type) VALUES (?, ?, ?, ?)
        bind => [231285, smtp, 25, 0]
[Message sent by forum member 'server_user' (server_user)]

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