题
????????Hibernate???????,???P6SPY??MySQL JDBC???????,?????????????????????P6SPY???????? - ???????
!????????????Test1,?test1a?TEST1B???????????????????:
Hibernate:
/* insert com.play.hibernate1.Test1
*/ insert
into
Test1
(name, value, id)
values
(?, ?, ?)
1274973057265|1|1|batch|/* insert com.play.hibernate1.Test1 */ insert into Test1 (name, value, id) values (?, ?, ?)|/* insert com.play.hibernate1.Test1 */ insert into Test1 (name, value, id) values ('Test 1', 10, 5)
Hibernate:
/* insert com.play.hibernate1.Test1
*/ insert
into
Test1
(name, value, id)
values
(?, ?, ?)
1274973057265|0|1|batch|/* insert com.play.hibernate1.Test1 */ insert into Test1 (name, value, id) values (?, ?, ?)|/* insert com.play.hibernate1.Test1 */ insert into Test1 (name, value, id) values ('Test 2', 20, 6)
1274973057267|2|1|statement|/* insert com.play.hibernate1.Test1 */ insert into Test1 (name, value, id) values (?, ?, ?)|/* insert com.play.hibernate1.Test1 */ insert into Test1 (name, value, id) values ('Test 2', 20, 6)
1274973057268|0|1|commit||
???????“?”???,??????JDBC API addBatch,????“1274973057267 | 2 | 1?|??”????????????????????,?????????????????3??????,????????
?????????????????
????????spy.properties“?”,?????????,????
????????!
解决方案
Ah - I see the problem, which appears to be due to what I have to say is a rather surprising design decision in p6spy.
Apparently for batched statements, the decision was made to log statements as they are added to the batch, and then show the LAST statement executed when the batch is actually executed! Once you know that's what the tool does, I guess you can understand why it's there, but it's completely confusing and counter-intuitive unless you happen to have read the thread here:
http://sourceforge.net/projects/p6spy/forums/forum/166969/topic/666877
其他提示
In *spy.propertie*s file, the default property of excludecategories
is [info,debug,result,batch
],
You can exclude the batch
category, then you will get what you want.
The tail end of it (513) looks like part of the timestamp