Home > Back-end >  Questions about serviceimpl execution caton, fairy the way, have a few days
Questions about serviceimpl execution caton, fairy the way, have a few days

Time:09-24

Everybody is good, recently had an HTTP service, pass through json receiving service data,
Because application scenario is very simple, direct use the ready-made DWZ framework, for springmvc + mybatis,
Also use this architecture before, feel, still can be found nothing problem,
But strange problems in using this, my first words description:
Don't know under what circumstances, the controller invokes the service implementation to perform persistence operations, will be caton,
Caton is used to describe don't know whether reasonable, also can hang on, or what, in short, through the HTTP request to the controller and then call the service implementation for database query, not immediately implement the service implementation class methods, I found, the debug system. The first line even if in the implementation class out. Print (1); Won't be executed immediately, but in a few seconds, and even a few seconds, a minute will continue to execute and return to normal, the contents of the two at the time of caton spooled asked below


After the restart the service, no matter how to invoke any controller of any service query any table, all no problem, but don't know what circumstance in use after the restart, will enter a state of caton, and once you start caton, every request will be caton,

Don't know what reason is caused, related to the environment? Things about? Database, etc.? Please tell the great god, thank you very much ~!

CodePudding user response:

In addition, once the state of the problem, if I had the same HTTP request three times, then can output three times above the bottom two lines of log, and after waiting time, three service implementation class is performed at the same time; If my this request is to insert a user, the service in the library query table to verify the user name may not be repeated, but the above situation, three of the same user will after caton insert success at the same time, and without any proof, that is to say, three records of the insert is simultaneously

CodePudding user response:

All the work? Friday is not tie to hi, don't only I in overtime, calling upon the villagers

CodePudding user response:

Continue to call, this problem does not solve sleep

CodePudding user response:

In front of a selectProvince method for transaction isolation level is required will block the current thread

CodePudding user response:

reference 4 floor hanpoyangtitan response:
front have a selectProvince method for transaction isolation level is required will block the current thread operation

Thank you, at first I think that is a question of things, is set before the PROPAGATION_REQUIRES_NEW, hangs,
But later changed to PROPAGATION_REQUIRED for new things, this is not correct, please give directions,

CodePudding user response:

reference 5 floor u013475083 reply:
Quote: refer to 4th floor hanpoyangtitan response:

In front of a selectProvince method for transaction isolation level is required will block the current thread operation

Thank you, at first I think that is a question of things, is set before the PROPAGATION_REQUIRES_NEW, hangs,
But later changed to PROPAGATION_REQUIRED for new things, this is not correct, please give directions,

You remove the selectProvince first try

CodePudding user response:

refer to 6th floor hanpoyangtitan response:
Quote: refer to the fifth floor u013475083 reply:

Quote: refer to 4th floor hanpoyangtitan response:

In front of a selectProvince method for transaction isolation level is required will block the current thread operation

Thank you, at first I think that is a question of things, is set before the PROPAGATION_REQUIRES_NEW, hangs,
But later changed to PROPAGATION_REQUIRED for new things, this is not correct, please give directions,

You remove the selectProvince first try

Not this one problem, as long as a caton, access to which the service is the same, this is the foundation of the login

CodePudding user response:

CodePudding user response:

refer to 7th floor u013475083 response:
Quote: refer to the sixth floor hanpoyangtitan response:

Quote: refer to the fifth floor u013475083 reply:

Quote: refer to 4th floor hanpoyangtitan response:

In front of a selectProvince method for transaction isolation level is required will block the current thread operation

Thank you, at first I think that is a question of things, is set before the PROPAGATION_REQUIRES_NEW, hangs,
But later changed to PROPAGATION_REQUIRED for new things, this is not correct, please give directions,

You remove the selectProvince first try

Not this one problem, as long as a caton, access to which the service is the same, this is the foundation of the login

You are not a debug? Into the controller card?

CodePudding user response:

refer to the eighth floor u013475083 response:

Into the controller will not card, the card in the controller of the first call to the service implementation, no matter he is which implementation class, as long as it is the controller first perform the service implementation gets stuck, and the service implementation method does not perform, even no output, until the end of the waiting,

CodePudding user response:

You are to say, just start is normal, caton can only be seen after running a stage, and see you said even the system out, printl caton, so long there is only one reason, is the problem that the JVM, also just started well, with a high level, should be light, is the resource could not be recycled question, what do you look at your that DWZ framework; Sure is a problem here, cause resource has been hijacked not release;

CodePudding user response:

references to the tenth floor u013475083 response:
Quote: refer to the eighth floor u013475083 response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related