I’ve created a new Oracle database and table for my new spring boot rest API.
my API has 3 endpoints for insertion, deletion and retrieval. when I inserted the values from insert endpoint it is giving me a success message and also verified the insertion in the table.
for some reason, I’ve deleted the entries from the table using Oracle SQL Developer UI manually. When I try to hit the Retrieval endpoint I’m still able to see those entries
It looks weird that how can my API able to retrieve values even though they are not in the Database. I’m having these configurations for creating and drop table from the application.properties
# create and drop tables and sequences, loads import.sql spring.jpa.hibernate.ddl-auto=none spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true;
but I’ve checked that there is no new table is created and the values are storing in the table which I created.
I’ve also included Transaction management in my Application class @EnableTransactionManagement
Can someone help me with this? I could provide more details if needed
Advertisement
Answer
Your transaction isnt commited after deleting it manually. Use commit after delete
Commit