Test Practice Results Test Practice Results 1: Multiple threads use an object method, the method is not synchronized, establish and close the connection internally, do the query database and update the four threads obtained by the query out the results of the four threads are independent, Four sessions simultaneously read a record, the result of the readout, so that the data obtained by three threads is spam, update the result error 5: Multiple threads use an object, the method is not synchronized, The external to the method is established and closed, and the query database and update the results of the query out the result of the result of the result of a thread only with one session binding, a session to query data, always get the result of the last operation of the session. Result, If the thread 1 reads out when the first update is read, the value read is 1, the value read is 1, and the value of the n-read is N-1, which is not affected by other threaded session. Therefore, in the case where the transaction is submitted, but the session is not closed, each session has the result of the last operation in memory 2: Multiple threads use an object method, method synchronization, in the internal establishment and closing connection, Do the results of the query database and update the results of the query results. 6: Multiple threads use an object method, method synchronization, establish and close the connection outside the method, do the query database and update the results of the query out the result of the result, Because only one thread operation method is only one thread operation method, it can confirm that the 5 inferration 3: Multiple threads use a class of multiple object instances, the method is synchronized, establish and close the connection inside the method, and query the database and Update the results of the query out of the results and 1, using the unique object instance, the method is not the same as the synchronization result. The synchronization of the method is synchronized to access all the objects where this method is located. If each thread creates an object, then the synchronization of the method will not reach the effect 7: Multiple threads use a class of multiple object instances, methods Synchronize, establish and close the connection outside the method, do the query database and update the results of the query out the results of the results, each thread has created an object, so the synchronization of the object method can not achieve the expected result 4: Multiple threads use a class The method of an object instance, the method is not synchronized, establishing and closing the connection inside the method, making the query database and updating the results of the query out the results of the results here, 3 and 4 practice does not distinguish 8: Multiple threads use one Multiple object instances of the class, the method is not synchronized, establishing and closing the connection outside the method, making the query database and updating the results of the results of the results are the same as 7, in the case of 7 and 8, there is no difference