Home > database >  After the success of the Java insert data, call Python interface, data query is less than a number l
After the success of the Java insert data, call Python interface, data query is less than a number l

Time:09-19

The Spring framework, MyBatis
Python with MySQLdb

Java code below
 
For (named OrderDetail named OrderDetail: orderDetailList) {
TicketBought TicketBought=new TicketBought ();
TicketBought. SetOrderId (order getId ());
.
Try {
TicketBoughtService. Insert (ticketBought);
} the catch (Exception e) {
e.printStackTrace();
}
}
New Thread () {
Public void the run () {
//HTTP request python interface (incoming orderId)
};
}. The start ();


Python code is very simple, is in accordance with the orderId number query out all bought

But at the time of the query, can appear no corresponding orderId bought data, or insert the article 5, I query out only 2

Data table is innodb
The autocommit is ON
Tx_isolation is REPEATABLE READ

Don't know if it because the transaction, or is caused by insert buffer innodb index is a little bit more (the table)


  • Related