 MYBATIS Quick Guideof type JDBC, the application is responsible for the transaction management operations, such as, commit, roll-back, etc... If we use the transaction manager of type MANAGED, the application server is password We use the transaction manager of type JDBC, means we have to perform the operations, such as commit and roll-back manually, within the application. We use the dataSource of type UNPOOLED, which means insert("Student.insert", student); System.out.println("record inserted successfully"); session.commit(); session.close(); } } Compilation and Execution Here are the steps to compile0 码力 | 34 页 | 301.72 KB | 1 年前3 MYBATIS Quick Guideof type JDBC, the application is responsible for the transaction management operations, such as, commit, roll-back, etc... If we use the transaction manager of type MANAGED, the application server is password We use the transaction manager of type JDBC, means we have to perform the operations, such as commit and roll-back manually, within the application. We use the dataSource of type UNPOOLED, which means insert("Student.insert", student); System.out.println("record inserted successfully"); session.commit(); session.close(); } } Compilation and Execution Here are the steps to compile0 码力 | 34 页 | 301.72 KB | 1 年前3
 Apache ShardingSphere 5.4.1 Document528 x Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 12.5.3 Seata 530 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 12.6 Data Migration 6.8 Other The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 556 13.6.9 Other Why is the database0 码力 | 572 页 | 3.73 MB | 1 年前3 Apache ShardingSphere 5.4.1 Document528 x Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 12.5.3 Seata 530 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 12.6 Data Migration 6.8 Other The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 556 13.6.9 Other Why is the database0 码力 | 572 页 | 3.73 MB | 1 年前3
 Apache ShardingSphere v5.5.0 document557 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558 12.5.3 Seata 559 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560 12.6 Data Migration 6.8 Other The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 585 13.6.9 Other Why is the database0 码力 | 602 页 | 3.85 MB | 1 年前3 Apache ShardingSphere v5.5.0 document557 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558 12.5.3 Seata 559 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560 12.6 Data Migration 6.8 Other The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 585 13.6.9 Other Why is the database0 码力 | 602 页 | 3.85 MB | 1 年前3
 Apache ShardingSphere 5.2.0 Document389 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 7.5.3 Seata 391 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 7.6 Data Migration 6.8 Other The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 463 8.6.9 Other Why is the database sharding0 码力 | 483 页 | 4.27 MB | 1 年前3 Apache ShardingSphere 5.2.0 Document389 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 7.5.3 Seata 391 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 7.6 Data Migration 6.8 Other The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 463 8.6.9 Other Why is the database sharding0 码力 | 483 页 | 4.27 MB | 1 年前3
 Apache ShardingSphere 5.2.1 Document416 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 7.5.3 Seata 418 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419 7.6 Data Migration 6.8 Other The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 502 8.6.9 Other Why is the database sharding0 码力 | 523 页 | 4.51 MB | 1 年前3 Apache ShardingSphere 5.2.1 Document416 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 7.5.3 Seata 418 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419 7.6 Data Migration 6.8 Other The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 502 8.6.9 Other Why is the database sharding0 码力 | 523 页 | 4.51 MB | 1 年前3
 Apache ShardingSphere 5.1.1 Document274 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 7.3.3 Seata 276 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 7.4 Scaling 28 [Other] The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 354 7.8.29 [Other] Why is the database0 码力 | 458 页 | 3.43 MB | 1 年前3 Apache ShardingSphere 5.1.1 Document274 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 7.3.3 Seata 276 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 7.4 Scaling 28 [Other] The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 354 7.8.29 [Other] Why is the database0 码力 | 458 页 | 3.43 MB | 1 年前3
 Apache ShardingSphere 5.0.0-alpha Document301 7.24 The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 viii 1 transaction life cycle. The initiator of global transaction is TM, which is in charge of begin and commit/rollback of global transaction. The participant of global transaction is RM, which is in charge asks TC for commit or rollback the corresponding global transaction of XID. 5. TC drives all branch transactions under the corresponding global transaction of XID to finish branch commit or rollback0 码力 | 311 页 | 2.09 MB | 1 年前3 Apache ShardingSphere 5.0.0-alpha Document301 7.24 The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 viii 1 transaction life cycle. The initiator of global transaction is TM, which is in charge of begin and commit/rollback of global transaction. The participant of global transaction is RM, which is in charge asks TC for commit or rollback the corresponding global transaction of XID. 5. TC drives all branch transactions under the corresponding global transaction of XID to finish branch commit or rollback0 码力 | 311 页 | 2.09 MB | 1 年前3
 Apache ShardingSphere 5.1.2 Document285 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 7.3.3 Seata 287 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 7.4 Scaling 28 [Other] The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 366 7.8.29 [Other] Why is the database0 码力 | 503 页 | 3.66 MB | 1 年前3 Apache ShardingSphere 5.1.2 Document285 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 7.3.3 Seata 287 Execute actual sharding SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 Commit or Rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 7.4 Scaling 28 [Other] The ANTLR plugin generates codes in the same level directory as src, which is easy to commit by mistake. How to avoid it? . . . . . . . . . . . . . . . 366 7.8.29 [Other] Why is the database0 码力 | 503 页 | 3.66 MB | 1 年前3
 传智播客 mybatis 框架课程讲义setSex("1"); user.setPrice(1999.9f); sqlSession.insert("test.insertUser", user); //提交事务 sqlSession.commit(); } catch (Exception e) { e.printStackTrace(); } finally { if (sqlSession != null) { sqlSession sqlSessionFactory.openSession(); // 删除用户 sqlSession.delete("test.deleteUserById",18); // 提交事务 sqlSession.commit(); } catch (Exception e) { e.printStackTrace(); } finally { if (sqlSession != null) { sqlSession setSex("1"); user.setPrice(1999.9f); sqlSession.update("test.updateUser", user); // 提交事务 sqlSession.commit(); } catch (Exception e) { e.printStackTrace(); } finally { if (sqlSession != null) { sqlSession0 码力 | 75 页 | 1.16 MB | 1 年前3 传智播客 mybatis 框架课程讲义setSex("1"); user.setPrice(1999.9f); sqlSession.insert("test.insertUser", user); //提交事务 sqlSession.commit(); } catch (Exception e) { e.printStackTrace(); } finally { if (sqlSession != null) { sqlSession sqlSessionFactory.openSession(); // 删除用户 sqlSession.delete("test.deleteUserById",18); // 提交事务 sqlSession.commit(); } catch (Exception e) { e.printStackTrace(); } finally { if (sqlSession != null) { sqlSession setSex("1"); user.setPrice(1999.9f); sqlSession.update("test.updateUser", user); // 提交事务 sqlSession.commit(); } catch (Exception e) { e.printStackTrace(); } finally { if (sqlSession != null) { sqlSession0 码力 | 75 页 | 1.16 MB | 1 年前3
 Apache ShardingSphere v5.5.0 中文文档计目标。 8.2.4 原理介绍 ShardingSphere 对外提供 begin/commit/rollback 传统事务接口,通过 LOCAL,XA,BASE 三种模式提 供了分布式事务的能力, LOCAL 事务 LOCAL 模式基于 ShardingSphere 代理的数据库 begin/commit/rolllback 的接口实现,对于一条逻 辑 SQL,ShardingSphere SQL,ShardingSphere 通过 begin 指令在每个被代理的数据库开启事务,并执行实际 SQL,并执行 commit/rollback。由于每个数据节点各自管理自己的事务,它们之间没有协调以及通信的能力,也 并不互相知晓其他数据节点事务的成功与否。在性能方面无任何损耗,但在强一致性以及最终一致性方 面不能够保证。 XA 事务 XA 事务采用的是 X/OPEN 组织所定义的 DTP 模型 所抽象的 AP(应用程序) ShardingSphere 代理的数据库 xa start/end/prepare/commit/rollback/recover 的接口上。 对于一条逻辑 SQL,ShardingSphere 通过 xa begin 指令在每个被代理的数据库开启事务,内部集成 TM,用于协调各分支事务,并执行 xa commit/rollback。 基于 XA 协议实现的分布式事务,由于在执行的过程中需要对所需资源进行锁定,它更加适用于执行时间0 码力 | 557 页 | 4.61 MB | 1 年前3 Apache ShardingSphere v5.5.0 中文文档计目标。 8.2.4 原理介绍 ShardingSphere 对外提供 begin/commit/rollback 传统事务接口,通过 LOCAL,XA,BASE 三种模式提 供了分布式事务的能力, LOCAL 事务 LOCAL 模式基于 ShardingSphere 代理的数据库 begin/commit/rolllback 的接口实现,对于一条逻 辑 SQL,ShardingSphere SQL,ShardingSphere 通过 begin 指令在每个被代理的数据库开启事务,并执行实际 SQL,并执行 commit/rollback。由于每个数据节点各自管理自己的事务,它们之间没有协调以及通信的能力,也 并不互相知晓其他数据节点事务的成功与否。在性能方面无任何损耗,但在强一致性以及最终一致性方 面不能够保证。 XA 事务 XA 事务采用的是 X/OPEN 组织所定义的 DTP 模型 所抽象的 AP(应用程序) ShardingSphere 代理的数据库 xa start/end/prepare/commit/rollback/recover 的接口上。 对于一条逻辑 SQL,ShardingSphere 通过 xa begin 指令在每个被代理的数据库开启事务,内部集成 TM,用于协调各分支事务,并执行 xa commit/rollback。 基于 XA 协议实现的分布式事务,由于在执行的过程中需要对所需资源进行锁定,它更加适用于执行时间0 码力 | 557 页 | 4.61 MB | 1 年前3
共 24 条
- 1
- 2
- 3













