Skip to content

Issue with transaction handling #18

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

Merged
merged 1 commit into from
Jun 4, 2014
Merged

Conversation

davydkov
Copy link
Contributor

@davydkov davydkov commented Jun 4, 2014

I faced with the problem that when transaction is failed the connection becomes absolutely useless and further requests lead to exceptions.

After looking at the documentation of postgrsql-async@mauricio I realized that scalikejdbc-async handles transaction in its own way, while driver already provides such functionality.
Also @mauricio recommends:

You should not reuse a database connection that has rolled back a transaction, just close it and create a new connection to continue using it.

So I suggest:

  • use transaction's handling via driver
  • remove code related to the old version of driver

Well, at least these changes work for me and my project

@mauricio
Copy link

mauricio commented Jun 4, 2014

👍 that.

Documentation for the network protocol for both databases say that reusing connections that failed for any reason or were rolled back is not advisable.

@seratch seratch added the bug label Jun 4, 2014
@seratch seratch self-assigned this Jun 4, 2014
@seratch
Copy link
Member

seratch commented Jun 4, 2014

Thanks.

I just tried your change but some unit tests with PostgreSQL occasionally fail. My work around code in AsyncDBSession.scala seems to be still needed.

Changes on AsyncDB.scala look reasonable. If you don't mind, please revert changes on AsyncDBSession.scala.

@seratch seratch added enhancement and removed bug labels Jun 4, 2014
@davydkov
Copy link
Contributor Author

davydkov commented Jun 4, 2014

@seratch I reverted changes of AsyncDBSession

seratch added a commit that referenced this pull request Jun 4, 2014
Issue with transaction handling
@seratch seratch merged commit e8b5d8c into scalikejdbc:develop Jun 4, 2014
@seratch seratch added the bug label Jul 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants