貌似是缓存没有成功
17:57:35.624 [http-nio-8081-exec-4] DEBUG org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [GET] path=/api/user/add : UserModule.add(UserModule.java:32)
17:57:35.624 [http-nio-8081-exec-4] DEBUG org.nutz.ioc.impl.NutIoc - Get 'userModule'<class com.mysada.module.UserModule>
17:57:35.625 [http-nio-8081-exec-4] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM t_user WHERE name=? LIMIT 0, 1
| 1 |
|-------|
| rekoe |
For example:> "SELECT * FROM t_user WHERE name='rekoe' LIMIT 0, 1 "
17:57:35.643 [http-nio-8081-exec-4] TRACE org.nutz.dao.impl.sql.run.NutDaoExecutor - ...DONE
17:57:35.647 [http-nio-8081-exec-4] DEBUG net.sf.ehcache.store.disk.Segment - put added 0 on heap
17:57:35.648 [t_user.data] DEBUG net.sf.ehcache.store.disk.Segment - fault removed 0 from heap
17:57:35.650 [t_user.data] DEBUG net.sf.ehcache.store.disk.Segment - fault added 0 on disk
ehcache.js文件
var ioc = {
cacheManager : {
type : "net.sf.ehcache.CacheManager",
factory : "net.sf.ehcache.CacheManager#create"
}
};
dao.js
var ioc = {
conf : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : [ "custom/" ]
}
},
dataSource : {
factory : "$conf#make",
args : [ "com.alibaba.druid.pool.DruidDataSource", "db." ],
type : "com.alibaba.druid.pool.DruidDataSource",
events : {
create : "init",
depose : 'close'
}
},
dao : {
type : "org.nutz.dao.impl.NutDao",
args : [ {
refer : "dataSource"
} ],
fields : {
executor : {
refer : "cacheExecutor"
}
}
},
cacheExecutor : {
type : "org.nutz.plugins.cache.dao.CachedNutDaoExecutor",
fields : {
cacheProvider : {
refer : "cacheProvider"
},
cachedTableNames : [ "t_user" ],
enableWhenTrans : false, // 事务作用域内不启用缓存,默认也是false
db : "MYSQL"
}
},
cacheProvider : {
type : "org.nutz.plugins.cache.dao.impl.provider.EhcacheDaoCacheProvider",
fields : {
cacheManager : {
refer : "cacheManager"
}
},
events : {
create : "init"
}
}
};