rbatis add begin
@@ -122,7 +122,7 @@ impl Rbatis {
return self.eval_raw("eval_sql", eval_sql, is_select, &mut arg_array);
}
- pub fn begin(&mut self, id: &str, propagation_type: Option<Propagation>) -> Result<&mut LocalSession, String> {
+ pub fn begin(&mut self, id: &str, propagation_type: Propagation) -> Result<&mut LocalSession, String> {
let key = (self.router_func)(id);
let db_conf_opt = self.db_driver_map.get(key.as_str());
if db_conf_opt.is_none() {
@@ -131,9 +131,7 @@ impl Rbatis {
let driver = db_conf_opt.unwrap();
let thread_id = thread::current().id();
let session = self.session_factory.get_thread_session(&thread_id, driver.as_str())?;
-// {
-// session.begin(propagation_type)?;
-// }
+ session.begin(propagation_type)?;
return Result::Ok(session);
}
pub fn commit(&mut self, id: &str) -> Result<u64, String> {
