#Springboot application: problem with Hibernate flush (maybe)

14 messages · Page 1 of 1 (latest)

umbral robin
#

Hi everyone, I have a problem when trying to add an entry to a table. The context is that I have an application where a user can follow plants and gets info from their status (air moisture, watering, etc...). The first 2 entries get saved in the database correctly, but when I try to add a third, I get an error (see below).
It seems like the second query gets executed again and this gives the error (even though a complete different query was executed). By doing some debugging, I can see that the parameters passed are actually correct in the repository and in the service.
Doing some research I found out that it could be an hibernate flush problem(???), but I cannot manage to force a flush. I already tried to set the batch size to 1, but that didn't help.
Any suggestions?

forest mesaBOT
#

This post has been reserved for your question.

Hey @umbral robin! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

umbral robin
#

error and relevant code snippets in message.txt

forest mesaBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

umbral robin
#

.

forest mesaBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

umbral robin
#

.

hardy sun
#

are you inserting the same thing multiple times?

#

Or does the user have the same plant multiple times?

forest mesaBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

latent herald
#

Hi

hardy sun