The for loop in the looping_java_code.txt file calls the getItemByBggId method in the ItemRepository class. When the getItemByBggId method is called a second time, the entitymanager persists and throws the exception. Notice the code that is commented out in getItemByBggId; that is the native query that causes the error to be thrown. When I changed the code to us JP-QL (not commented out) the error is not thrown. I included the pom.xml and persistence.xml so you can see what JEE components I am using.
|