1.问题:用JDBC批量插入数据库(主从),主库正常插入,但是从库完法进行同步,查看日志发现在日志中的insert语句存在十六进制数。。。从而无法同步从数据库。
问题解决:更换jdbc驱动包,更新到mysql-connector-java-5.0.8-bin.jar或以上版本。。。
问题版本:mysql-connector-java-5.0.3-bin.jar
-------------------------------------------------
2.xml rpc中无法实现长连接。
PropertyHandlerMapping mapping = new PropertyHandlerMapping();
mapping.addHandler("PasswordModiServiceImpl", PasswordModiServiceImpl.class);
MyWebServer webServer = new MyWebServer(8080);
webServer.getXmlRpcServer().setHandlerMapping(mapping);
webServer.getXmlRpcServer().setMaxThreads(2);
XmlRpcServerConfigImpl cfg = (XmlRpcServerConfigImpl)webServer.getXmlRpcServer().getConfig();
cfg.setKeepAliveEnabled(true);
webServer.start();
======================
class MyWebServer extends WebServer {
protected ThreadPool pool;
MyWebServer(int pPort) {
super(pPort);
}
public ThreadPool newThreadPool(){
pool = new ThreadPool(getXmlRpcServer().getMaxThreads(), "XML-RPC"){
};
return pool;
}
int getNumThreads() {
return pool.getNumThreads();
}
}
========================
Map<String, String> map = new HashMap<String, String>();
map.put(Customer.CUSTOMER_ID, "00000001");
map.put(Customer.PW, "111111");
map.put(Customer.SYSTEM_ID, "FX");
Object[] params = new Object[] { map };
long start=0;
XmlRpcClient client = new XmlRpcClient();
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL("http://10.15.3.80:8080/"));
client.setConfig(config);
Ant a1=new Ant(client, params);
Ant a2=new Ant(client, params);
Ant a3=new Ant(client, params);
Ant a4=new Ant(client, params);
a1.start();
a2.start();
===========================
try {
//this.wait();
for (int i = 0; i < 3; i++) {
Object[] result = (Object[]) client.execute("PasswordModiServiceImpl.process", params);
System.out.println(((Map) result[0]).get("SUCCESS_FLAG"));
}
} catch (Exception e) {
e.printStackTrace();
}
=============================
不加注释了。。。。