Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL + CREATE PROCEDURE At first ( When No Cached ) TRANSACTION ( BEGIN to ROLLBACK ) does not work well #119

Open
YumaInaura opened this issue Jun 19, 2019 · 0 comments

Comments

@YumaInaura
Copy link

Example

    ActiveRecord::Base.transaction do
      upsert = Upsert.new Pet.connection, Pet.table_name
      upsert.row({:name => rand(999999)}, :breed => 'beagle', :created_at => Time.now)
      raise ActiveRecord::Rollback
    end

First time

Pet.count # => 1

Second Time

Pet.count # => 1

Cause

is maybe BEGIN and ROLLBACK order?

First time

BEGIN

CREATE PROCEDURE
(many lines)

CALL PROCEDURE

ROLLBACK

Second time ( created PROCEDURE cached )

BEGIN

CALL PROCEDURE

ROLLBACK
@YumaInaura YumaInaura changed the title MySQL + CREATE FIRST PROCEDURE (No Cached) ROLLBACK does not work MySQL + CREATE PROCEDURE First time (No Cached) TRANSACTION ( BEGIN to ROLLBACK ) does not work well Jun 19, 2019
@YumaInaura YumaInaura changed the title MySQL + CREATE PROCEDURE First time (No Cached) TRANSACTION ( BEGIN to ROLLBACK ) does not work well MySQL + CREATE PROCEDURE At first ( When No Cached ) TRANSACTION ( BEGIN to ROLLBACK ) does not work well Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant