0

This is in continuation with one of my older questions. I want to execute a program based on two conditions, N inserts in a database and time interval. I got two brilliant answers as well. This is one of them, here.

I implemented the solution in similar lines. So, I expected the program to run according to both threads -A run because of database check at every single minute and time based run at every 5 minutes. But I am seeing only time based running happens every 5 minutes and database checking is happening just once.

Could you please advise what causes this.

Community
  • 1
  • 1
pnv
  • 1,437
  • 3
  • 23
  • 52

1 Answers1

0

Thanks everyone who thought of helping out!

Here the issue was this- I was making use of another class to check database inserts. The object of this class was created in the constructor of this listener class, that is only once. I think for every thread this requires to be recreated. Once I did this, it started working well.

pnv
  • 1,437
  • 3
  • 23
  • 52