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

Wrong parameters list in MS SQL Server statements #11

Closed
orsonek opened this issue Jan 12, 2015 · 2 comments · Fixed by #15
Closed

Wrong parameters list in MS SQL Server statements #11

orsonek opened this issue Jan 12, 2015 · 2 comments · Fixed by #15

Comments

@orsonek
Copy link

orsonek commented Jan 12, 2015

In file journal/Statements.scala a parameter is missing for MS SQL Server (3 '?', expected 4). After correction some other exception are thrown and simple workaround (no binding) may be applied:

trait MSSqlServerStatements extends GenericStatements {
override def selectMessagesFor(persistenceId: String, fromSequenceNr: Long, toSequenceNr: Long, max: Long): List[PersistentRepr] = {
SQL(s"SELECT TOP $max message FROM $schema$table WHERE persistence_id = '$persistenceId' AND (sequence_number >= $fromSequenceNr AND sequence_number <= $toSequenceNr) ORDER BY sequence_number")
//.bind(max, persistenceId, fromSequenceNr, toSequenceNr)
.map(rs => Journal.fromBytes(Base64.decodeBinary(rs.string(1))))
.list()
.apply
}
}

@dnvriend
Copy link
Contributor

Please alter the source code and issue a pull request. It would be nice to have a MS SQL Server available as a docker image so I can test it..

@bpg
Copy link

bpg commented Feb 18, 2015

Pull request #15 fixes this issue and couple of other SQL Server -specific minors. Works fine in my environment.
I'm planning to make an additional improvement there, similar to #13 -- to convert INSERT-fail-UPDATE logic into a stored procedure.

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

Successfully merging a pull request may close this issue.

4 participants