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

Scala redis - Unicode strings insertion problem #1

Open
ghost opened this issue Jul 14, 2010 · 0 comments
Open

Scala redis - Unicode strings insertion problem #1

ghost opened this issue Jul 14, 2010 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 14, 2010

Hi,

I was trying out your scala-redis library for my project. I encountered problems when inserting unicode strings into redis database.
Some of the unicode strings are not inserted at all, some of them are getting inserted but only a part of it. I tried with my scala interpreter too. At one point it just give array index out of bounds exception or it hangs (infinite loop or something). I have dumped the errors below.

Please let me know, if you have any suggestions or fixes for this.
I appreciate any kind of input.

Thank you.

Sincerely,
Anandan Rangasamy.

Here's the dump:
//one part of it
scala> val r = new Redis()
r: com.redis.Redis = localhost:6379 connected:true

scala> r.pushHead("Aäko","Aäkon Këëtrëh")
res7: Boolean = true

scala> r.listLength("Aäko")
res8: Option[Int] = None

//another one

scala> val r = new Redis()
r: com.redis.Redis = localhost:6379 connected:true

scala> r.listLength("Aäko")
res6: Option[Int] = Some(2)

scala> r.listRange("Aäko",0,1)
java.lang.ArrayIndexOutOfBoundsException: 1
at com.redis.SocketOperations$class.bulkReply(SocketOperations.scala:152)
at com.redis.Connection.bulkReply(Connection.scala:8)
at com.redis.SocketOperations$$anonfun$listReply$1.apply(SocketOperations.scala:171)
at com.redis.SocketOperations$$anonfun$listReply$1.apply(SocketOperations.scala:170)
at scala.Range.foreach(Range.scala:44)
...
scala> r.listRange("Aal",0,1)
res1: Option[List[String]] = Some(List(Aal, Aalacho))

scala> r.listRange("Aän",0,1)
res2: Option[List[String]] = None

scala> r.listRange("Aan",0,-1)
res3: Option[List[String]] = Some(List(Aan, Aantar Lee Coates, Aantonio ZZ))

scala> r.listRange("Aäkon",0,-1)
java.lang.ArrayIndexOutOfBoundsException: 1
at com.redis.SocketOperations$class.bulkReply(SocketOperations.scala:152)
at com.redis.Connection.bulkReply(Connection.scala:8)
at com.redis.SocketOperations$$anonfun$listReply$1.apply(SocketOperations.scala:171)
at com.redis.SocketOperations$$anonfun$listReply$1.apply(SocketOperations.scala:170)
at scala.Range.foreach(Range.scala:44)

// anothe one, where it hangs (probably an infinite loop or something)
scala> import com.redis._
import com.redis._

scala> val r = new Redis()
r: com.redis.Redis = localhost:6379 connected:true

scala> r.listLength("Aäkon1")
res0: Option[Int] = Some(1)

scala> r.listRange("Aäkon1",0,-1)

RomezzBorisov referenced this issue in RomezzBorisov/scala-redis Jun 6, 2012
Implemented nodes migration support
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

0 participants