apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.39k stars 8.79k forks source link

Does seata have to work with jpa? Under mybatis, no undolog is generated. #1372

Closed misvcom closed 5 years ago

misvcom commented 5 years ago

Does seata have to work with jpa? Under mybatis, no undolog is generated.

zjinlei commented 5 years ago

All support. I think it is a configuration problem,such as DataSourceProxy. Please join the dingding group 23171167 to discuss.

xingfudeshi commented 5 years ago

Does seata have to work with jpa? Under mybatis, no undolog is generated.

The table undo_log should be created manually.

-- the table to store seata xid data
-- 0.7.0+ add context
-- you must to init this sql for you business databese. the seata server not need it.
-- 此脚本必须初始化在你当前的业务数据库中,用于AT 模式XID记录。与server端无关(注:业务数据库)
-- 注意此处0.3.0+ 增加唯一索引 ux_undo_log
drop table `undo_log`;
CREATE TABLE `undo_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `branch_id` bigint(20) NOT NULL,
  `xid` varchar(100) NOT NULL,
  `context` varchar(128) NOT NULL,
  `rollback_info` longblob NOT NULL,
  `log_status` int(11) NOT NULL,
  `log_created` datetime NOT NULL,
  `log_modified` datetime NOT NULL,
  `ext` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;