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

Constraints shouldn't be in transactions with queries #991

Open
cheerfulstoic opened this issue Oct 16, 2015 · 8 comments
Open

Constraints shouldn't be in transactions with queries #991

cheerfulstoic opened this issue Oct 16, 2015 · 8 comments

Comments

@cheerfulstoic
Copy link
Contributor

Don't know how hard this would be, but I'm getting "Cannot perform schema updates in a transaction that has performed data updates." from Neo4j and I'm not quite sure how to fix it. I'll get it in the end, but don't want this to bite users

@subvertallchris
Copy link
Contributor

Is eager_load enabled in the app?

On Friday, October 16, 2015, Brian Underwood notifications@github.com
wrote:

Don't know how hard this would be, but I'm getting "Cannot perform schema
updates in a transaction that has performed data updates." from Neo4j and
I'm not quite sure how to fix it. I'll get it in the end, but don't want
this to bite users


Reply to this email directly or view it on GitHub
#991.

@cheerfulstoic
Copy link
Contributor Author

It isn't, but I'm running in development mode. We shouldn't have to enable eager_load to fix things, right?

Also I should make clear that this was happening because I was starting from a fresh database. The reason it was particularly a problem for me is because I wanted to create a Rails app that people could checkout and run the rake task (where this was happening) on a fresh DB

@subvertallchris
Copy link
Contributor

What about just adding a rake task to load the app so the schema changes
can take place? We can compare it to rake db:migrate and offer it as a
solution for this if/when it occurs.

On Friday, October 16, 2015, Brian Underwood notifications@github.com
wrote:

It isn't, but I'm running in development mode. We shouldn't have to enable
eager_load to fix things, right?

Also I should make clear that this was happening because I was starting
from a fresh database. The reason it was particularly a problem for me is
because I wanted to create a Rails app that people could checkout and run
the rake task (where this was happening) on a fresh DB


Reply to this email directly or view it on GitHub
#991 (comment).

@cheerfulstoic
Copy link
Contributor Author

Sure, I can certainly see that. I think DataMapper has a task that migrates SQL database to fit the schema specified in the model. It feels like there's got to be a way to execute a separate schema change query in a separate transaction, though, first. Maybe when the models are first loaded

@veetow
Copy link

veetow commented Feb 2, 2016

I'm getting the same error when running the db:seed rake task. I'm working on upgrading our app from a really old version of the gem to the latest. Eager load is enabled. Any ideas?

@subvertallchris
Copy link
Contributor

@veetow try opening the app once from the Rails console. It will connect to the server and build the schema, then you can run tasks and no more changes will be needed.

@veetow
Copy link

veetow commented Feb 2, 2016

That did it, and it entirely makes sense to me now. Adding a rake task to pre-load the schema as you suggested above would go a long way to prevent confusion for a lot of people.

@cheerfulstoic
Copy link
Contributor Author

I've also been working on a refactor of some things for the upcoming 7.0 release and I think that this issue will be resolved as part of that

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

3 participants