Subject Re: [firebird-support] Generator error
Author Martijn Tonies
Hi,

> 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);

Does the generator already exist?

> 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");

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum:
http://www.databasedevelopmentforum.com