http://img.mukewang.com/58468...
private static String dateFormat;
private static SerializeConfig mapping = new SerializeConfig();
static {
dateFormat = "yyyy-MM-dd HH:mm:ss";
mapping.put(Date.class, new SimpleDateFormatSerializer(dateFormat));
}
String jsonString = JSONObject.toJSONString(deal,mapping,SerializerFeature.WriteDateUseDateFormat);
这个方法是把jsonString放入redis中,但有两个方法同时放一个redis中,这两个方法的deal实体类中的属性还不相同,其他代码都一样,不知道是不是这个问题,希望有大神给解释一下
It seems that the thread of SimpleDateFormat is not safe, and multi-thread concurrency will cause this
It doesn’t feel necessary to be so complicated, it’s very simple to use
fastjson