-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add support for SQL Server #200
Conversation
Awesome! Perhaps it is an idea to merge this after #199. In that case we do not need support for the legacy schema for sql server. I still need to have a thorough look at this. I also noticed one if the travis builds failed (just tried to restart it). |
Yes I've noticed there seem to be intermittent failures on the 2.11 build. I have a Travis build hooked up to my fork and it passed maybe 50% of the time, so presumably load related. I haven't had a chance to investigate yet. Also Codacy seems to be incorrectly complaining about valid T-SQL schema, not sure if it is possible to tag the SQL dialect. In terms of merging once everything is reviewed and behaving, I have a fairly prompt requirement so would prefer sooner rather than later if at all possible, not sure what the timeline is for #199. I'd be happy to work on any updates required as part of that PR. |
It might take a while before #199 is completely ready. So perhaps we can merge this one before. The unstable travis build is a blocker though. This needs some investigation. Perhaps it is possible to reduce the number of events in the specific tests. I have also done this for some of the oracle tests which had some stability issues in the past. |
Sure I will take a look at this and get it passing reliably on Travis |
40afce0
to
0fe3cd3
Compare
It looks like rebasing on top of your |
or maybe not ... back to the drawing board. |
5c8e0d6
to
f875548
Compare
f875548
to
bb2f1e0
Compare
I think the tests are passing reliably now, I've run Travis hooked up to my repo 10 times against the latest commit successfully. The problem seemed to be down to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks a lot for this.
db.run(queries.writeJournalRows(xs).transactionally).map(_ => Unit) | ||
else | ||
// However transactionally causes H2 tests to fail | ||
db.run(queries.writeJournalRows(xs)).map(_ => Unit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why H2 is failing when using transactionally
? That's not normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot I had added this comment and merge it.
In any case, I don't think we are doing any harm here. Actually, I run this locally without the if/else and calling transactionally
. All H2 tests passed.
Moreover, we don't need it transactionally because we have only one DBIO
. transactionally
is only needed when we have many DBIOs and we want to run them all together in the same tx. That's not the case here. Here we have one DBIO
with many row inserts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the test failures were intermittent. Locally I also didn't have a problem, but maybe the Travis hardware was lower spec and caused the circuit breaker to time out. It's also not clear why this would reduce performance in H2 in the first place.
With regards to not requiring transactionally
, it certainly made a significant difference to SQL Server performance. It's calling JournalTableC ++= xs.sortBy(_.sequenceNumber)
but I have no idea how Slick handles this internally.
@@ -62,6 +62,7 @@ class PostgresJournalSpecSharedDb extends JdbcJournalSpec(ConfigFactory.load("po | |||
class PostgresJournalSpecPhysicalDelete extends JdbcJournalSpec(ConfigFactory.load("postgres-application.conf") | |||
.withValue("jdbc-journal.logicalDelete", ConfigValueFactory.fromAnyRef(false)), Postgres()) | |||
|
|||
class MySQLJournalSpec extends JdbcJournalSpec(ConfigFactory.load("mysql-application.conf"), MySQL()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! That one was missing and nobody noticed it. Thanks
@@ -17,7 +17,9 @@ done; | |||
} | |||
rm ./bintray.sbt | |||
|
|||
wait 5432 PostgreSQL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, PostgreSQL was not included by default?
Adds SQL Server schema and test updates. I created a derived SQL server [image](https://hub.docker.com/r/topaztechnology/mssql-server-linux/) that allows login and database creation on startup to facilitate testing. Write performance was initially poor vs Postgres, but significantly improved with use of `transactionally` in `BaseByteArrayJournalDao.writeJournalRows` This was based on a closed PR akka#108, thanks to @naferx
Adds SQL Server schema and test updates. I created a derived SQL server image that allows login and database creation on startup to facilitate testing.
Write performance was initially poor vs Postgres, but significantly improved with use of
transactionally
inBaseByteArrayJournalDao.writeJournalRows
This was based on a closed PR #108, thanks to @naferx