Subject Generator error
Author powderfingercrazy
Apr 2, 2010 4:08:24 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544351. unsuccessful metadata update
DEFINE GENERATOR failed
attempt to store duplicate value (visible to active transactions) in unique index "RDB$INDEX_11"


My java code is below. And the error is above. Does anyone know why I am getting this error?


Statement statement = connection.createStatement();
String command = "CREATE SEQUENCE gen_forms";
statement.executeQuery(command);

Statement statement4 = connection.createStatement();
String command4 = "SELECT NEXT VALUE FOR gen_forms as GEN_ID FROM RDB$DATABASE";
ResultSet rs4 = statement4.executeQuery(command4);
id = rs4.getInt("GEN_ID");