I created a JPA project that also has a Swing project for a GUI that utilizes the JPA code to insert a record in an Oracle table via a stored procedure. The table has a trigger on it that generates a new ID via sequence.nextval. The stored procedure has OUT parameter for the new ID. The problem is, that when the code executes, two entries are made into the table with the same data.
The call to getResultList() in the executing code below is to get the OUT parameter that contains the new ID value. The message box that pops up fires only once. When I execute this code from another project like in Main().... a "stand alone" project, ( in other words not using via a GUI) everything works as expected. Meaning no double insert.
It's only when I fire it off via this GUI that I get the double insert.
Joined: Jul 13, 2012
Problem solved. Changed code to....
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com