0

I need to understand, Is there anyway I can continuously look for change in Maria-DB table using Hibernate.

I have a spring boot application that is connected to Maria-DB. If some other application perform CURD on table, I want to catch that in spring.

If it's not possible using hibernate, suggest me alternative.

PS : This spring boot application is running is different Docker Container and Maria-DB is running is different Docker Container.

3
  • Neither Hibernate nor Maria-DB has support for change notifications. Commented Sep 12, 2018 at 10:45
  • Have a look at this lienk stackoverflow.com/questions/38630114/… Commented Sep 12, 2018 at 12:30
  • @cralfaro According to my understanding, hibernate interceptor work with session. Means if we perform action on Entity for same application then it will work.In my case some other application is performing CURD operations. Commented Sep 14, 2018 at 7:48

2 Answers 2

0

You can use Database Triggers, or better why don't you try enabling Hibernates 2nd level cache?

Sign up to request clarification or add additional context in comments.

1 Comment

As I have mentioned, triggers will not work here because my db is in different docker container and my application is in different docker container. Plus Hibernate Caches are within applications and here in this scenario curd operation will be performed by another application and that application will be on different docker container.
0

Solution to this specific problem is Spring Integration module as other ways not working here. I have create a sample application to demonstrate here you can find the source code

What this application does look database continuously.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.