1) Spring configuration file:
2) inherit the sqlmapclientdaosupport class from the daoimpl class. And register the sqlmapclient bean to this class.
Public class monitordaoimpl extends sqlmapclientdaosupport implementsImonitordao {
}
Class = "com. **. Dao. Monitor. impl. monitordaoimpl" autowire = "byname">
Sqlmap example:
Sqlmap Namespace = "Monitor" > Select ID = "T_trafficzoneifipapp" Parameterclass = "Java. util. hashmap" Resultclass = "Object. Monitor. Traffic"
experts are going to study the so-called transaction isolation level. In fact, the definition of these four levels is to solve the problem caused by the high concurrency of data, then what are the problems?
Dirty Read (dirty reading)
Unrepeatable read (non-repeatable)
Phantom Read (Phantom Read)
First look at "dirty reading", see "dirty" the word, I think of nausea, dirty. How can data be dirty? In fact, we often say "junk data". For example, there are two transactions, wh
Java underlying technology series-thread pool framework, java underlying
I. Thread Pool Structure
Ii. Example
Define thread Interface
Public class MyThread extends Thread {@ OverridePublicvoid run (){System. out. println (Thread. currentThread (). getName () + "executing ");}}
1: newSingleThreadExecutor
ExecutorService pool = Executors. newSingleThreadExecutor ();Thread t1 = new MyThread ();Thread t2 = new MyThread ();Thread t3 = new MyThread ();// Put the thread into the pool for executionPoo
update to be lost at the same time.In the T1 time opened the transaction 1,t2 time to open the transaction 2, in the T3 time transaction 1 from the database to remove the id= "402881e535194b8f0135194b91310001" data, T4 time Transaction 2 took out the same piece of data, T5 Time Transaction 1 update the Age field value to 30,t6 time Transaction 2 Update age to 35 and commit the data, but T7 transaction 1 rolls back the last value of transaction age is
-1-thread-1 in execution ... Pool-1-thread-1 in execution ... Pool-1-thread-1 in execution ... Pool-1-thread-1 in execution ... Pool-1-thread-1 in execution ... ②newfixedthreadexecutor (n) publicclass Testfixedthreadpool {publicstaticvoid main (string[] args) {//Create a thread pool that can reuse a fixed number of threadsExecutorservice pool = Executors.newfixedthreadpool (2); //creates an Runnable interface object that implements theThread T1 =NewMyThread (); Thread T2=NewMyThread (); Thread T
;
}
public void setId (int id) {
this.id = ID;
}
Public String GetName () {
return name;
}
public void SetName (String name) {
this.name = name;
}
}
Add data (each plate CI has a topic ti)
@Test public
void Testsave () {
Session session = Sf.opensession ();
Session.begintransaction ();
Each section CI has a topic under TI for
(int i=0; i
Here are the different tests for list and iterate
1.list Take All
@Test public
void TestOneAddNProblem1 () {
Session session
Tags: i+1 tab CER IMA log query build value shareOne: the first kind: Select (@i:[email protected]+1) as I, table_name.* from table_name, (select @i:=0) as it For example: (1) Simple example: Select (@i:[email protected]+1) i,user_id from spcp_user_20170803, (select @i:=0) as it ORDER by T.user_i D desc; (2) Complex example: SELECT(@i:[email protected]+1) as i,hs_cd,hs_owner_persons,hs_owner_certy_num,hs_full_addr,t5.value_name as Hs_type, T6.value_
Background:In MySQL ' Stringa ' + ' stringb ' This type of operation, inside MySQL will automatically convert to two double number to operate.--------------------------------------------------------------------------------------------------------------- -----------------Example:CREATE TABLE T5 (X varchar (+), Y varchar (32));INSERT into T5 (x, Y) VALUES (' Hello ', ' 100 ');Select X + ' y+ ' from
Label: elect T0.accusation_des, T0.submit_time, T0.result, T0.handle_time, T1.content, T4.nick_name,t5.conten
T,t6.ask_title, T7.state_name,t8.item_name,t9.school_name,t10.school_name,t12.school_name,t14.school_name From Wxcommunity.t_accusation t0 left join wxcommunity.t_comment t1 on T1.commentid=T0.commentid left JOIN wxcommunity.t_ask T2 on T2.askid=T1.askid left JOIN wxcommunity.t_school T9 on T9.schoolid=T2.schoolid left JOIN wxc
The so-called atomic weight is the operation of the variable operation is "atomic", the operation is not re-divided, it is thread-safe. Why use atomic variables, because multiple threads can also cause problems with a single variable operation. The security of concurrent access can be addressed through the volatile, synchronized keyword before Java5, but it is too cumbersome. After Java5, a toolkit java.util.concurrent.atomic for single-variable multithreaded concurrency security access is provi
> 2. view the select name from t1 field whose id is greater than 2; view the single Field update t1 set name = 'SB 'where id = 3; modify the record delete from t1 where id = 3. delete a record in two ways to clear the table record, but the latter is recommended to delete from t1; truncate t1; # When there is a large amount of data, the deletion speed is faster. The whole operation is to delete the auto-increment idcreate table t2 (id int primary key, name char (10 )); create table t3 (id int not
+ system time) = consumed at input and output and when the system performs other tasks
Python Timeit module
Can be used to do benchmark, you can easily repeat the number of execution of a program to see how many blocks the program can run. Refer to the previously written article.
CProfile
Take a look at the example of using annotations directly.
#coding =utf8def Sum_num (max_num): Total = 0 for i in range (max_num): total + = i return totaldef test (): C4/>total = 0 for i in
1)First say the tuple: a data structure, separated by commas, that is used to pass a combination of values to a program or operating system.NET Framework directly supports tuples of one to seven elementsTupleT1> TupleT1, T2> TupleT1, T2, T3> TupleT1, T2, T3, T4> TupleT1, T2, T3, T4, T5> TupleT1, T2, T3, T4, T5, T6> TupleT1, T2, T3, T4, T5, T6, T7> Rest property
. onClickListener {private MapView mapView; CustomsOsmdroidMapConfig config = new CustomsOsmdroidMapConfig (); // image map _ W is mocato projection _ c is the country's 2000 coordinate system OnlineTileSourceBase tianDiTuImgTileSource = new OnlineTileSourceBase ("Tian Di Tu Img", 1, 18,256 ,"", new String [] {" http://t1.tianditu.com/DataServer?T=img_w "," http://t2.tianditu.com/DataServer?T=img_w "," http://t3.tianditu.com/DataServer?T=img_w "," http://t4.tianditu.com/DataServer?T=img_w "," ht
by the system
Python timeit module
It can be used for benchmark, so that you can easily repeat the number of times a program is executed and check that the program can run multiple blocks. For more information, see the previous article.
CProfile
For more information, see the example with annotations.
# Coding = utf8def sum_num (max_num): total = 0 for I in range (max_num): total + = I return totaldef test (): total = 0 for I in range (40000): total + = I t1 = sum_num (100000) t2 = sum_num (2000
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.