You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2020. It is now read-only.
When I was testing the official sharding-seata demo ,the following problems are encountered.
private static Long insertOrder(final Connection connection, final Order order) { String sql = "INSERT INTO t_order (user_id, address_id, status) VALUES (?, ?, ?)"; try (PreparedStatement preparedStatement = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS)) { preparedStatement.setObject(1, order.getUserId()); preparedStatement.setObject(2, order.getAddressId()); preparedStatement.setObject(3, order.getStatus()); preparedStatement.executeUpdate(); try (ResultSet resultSet = preparedStatement.getGeneratedKeys()) { if (resultSet.next()) { order.setOrderId(resultSet.getLong(1)); } } } catch (final SQLException ignored) { } return order.getOrderId(); }
the original JDBC can rollback . but when replaced by mybatis , it can't be rollbacked.
The text was updated successfully, but these errors were encountered: