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

'sp_addsubscription' cannot be executed within a transaction. #2175

Closed
seb-urbaniak opened this issue Oct 17, 2018 · 2 comments
Closed

'sp_addsubscription' cannot be executed within a transaction. #2175

seb-urbaniak opened this issue Oct 17, 2018 · 2 comments

Comments

@seb-urbaniak
Copy link

@seb-urbaniak seb-urbaniak commented Oct 17, 2018

Which version and edition of Flyway are you using?

Flyway Community Edition 5.2.0 by Boxfuse

If this is not the latest version, can you reproduce the issue with the latest one as well?

I think we are on the latest v, if not - very close to it.

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

flyway.cmd

Which database are you using (type & version)?

Microsoft SQL Server Enterprise 64-bit (v14.0.3037.1)

Which operating system are you using?

Microsoft Windows 10 Enterprise 64bit (v10.0.17134)

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)

Defined afterMigrate.sql, with a
"exec sp_addsubscription @Publication ="
command in it.
Profile is using:
flyway.mixed=true

What did you expect to see?

Clean execution.

What did you see instead?

Executing SQL callback: afterMigrate
ERROR: Error while executing afterMigrate callback:
Migration afterMigrate.sql failed

SQL State : S0001
Error Code : 15002
Message : The procedure 'sp_addsubscription' cannot be executed within a transaction.


Could I suggest that a new flag is introduced in the profile, which would let me toggle if (or which) before or after Migrate callback scripts are executed within the TRAN BEGIN-COMMIT wrapper or NOT ?

@axelfontaine axelfontaine added this to the Flyway 5.2.1 milestone Oct 18, 2018
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Oct 23, 2018
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Oct 23, 2018

Ahhh very interesting! And there is zero documentation about this limitation on Microsoft's website! Fixed.

Please open additional issues if you find other procedures affected by this.

@seb-urbaniak
Copy link
Author

@seb-urbaniak seb-urbaniak commented Oct 27, 2018

Fix confirmed! Now works great. Vielen Dank Axel. (will log a somewhat related issue for beforeMigrate callback)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.