Home > Back-end >  Questions about springboot
Questions about springboot

Time:11-29

There is now a case, my dictionary table use very frequently, so I'm going to put it in the cache, the final plan springboot start class invokes the into a cache method, below is my code



Specific implementation is not said, the point is not this, after this, can start after obtaining the dictionary data and into the cache, but now appeared the phenomenon of the magic of a

If start to finish, I turn off the redis, the main thread will get stuck, can't perform any method, the console will display a reconnection (as if), picture below



This process continues until I opened the redis, including all the implementation after the request will be ready in redis, why?

CodePudding user response:

The wrote a wrong mysql to connect with you address is the same, always can't connection shall not try to connect again, if just skip whatever, then use the mysql does not make sense, because may be some network connection not causes, always try again next second may restore network, can normal use, if you don't need, also can close

CodePudding user response:

Estimated read threads with a thread to wait, and didn't set the timeout, or timeout time is very long, only read the data back,

CodePudding user response:

reference 1st floor also night reply:
the wrote a wrong mysql to connect with you address is the same, always connected must not try to connect again, if just skip whatever, then use the mysql does not make sense, because may be some network connection not causes, always try again next second may restore network, can normal use, if you don't need, also can turn off


But I write in other any place will not be like this, is in start classes like this, I think is the same, mysql,
  • Related