I don't get this.. (Yes, I am a rookie)

I'm trying to build a recipe application where I can store recipes.

I have a pointbase database and are running Bea Weblogic 8.1.

I wan't to be able to take care of errors when trying to adding a duplicate Ingredience to my INGREDIENCE_TYPE table. When I try to add a duplicate IngredienceType I get the following error:

Exception:javax.ejb.TransactionRolledbackLocalExce ption: EJB Exception: ; nested exception is: weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception: [java.sql.SQLException: Data exception -- row already exist in index UK_RECIPE on table INGREDIENCE_TYPE.]

I have the following code:

javax.naming.Context ctx = new javax.naming.InitialContext();
IngredienceTypeHome home = (IngredienceTypeHome) ctx.lookup("IngredienceTypeLocalHome");

try {
IngredienceType obj2 = (IngredienceType) home.createMethod1(new Long("1"), request.getParameter("ingredienceType") );

I tried to search with google and forums, but I can't seem to find anyone with the same problem with a solution. Can anyone please tell me what I am doing wrong and the proper way to do it.

If more information needed I can apply it.

/Regards Erik Andersson