DefaultTwoWayKey2StringMapper generates for ByteArrayKeys string keys that are
incompatible with Sybase character set
---------------------------------------------------------------------------------------------------------------------
Key: ISPN-1587
URL:
https://issues.jboss.org/browse/ISPN-1587
Project: Infinispan
Issue Type: Bug
Components: Loaders and Stores
Reporter: Martin Gencur
Assignee: Tristan Tarrant
When storing a key to a cache via HotRod client and having Jdbc string-based cache store
defined, the cache store throws the following exception when Sybase DB (15.5) is used:
{code}
11:03:39,635 ERROR [org.infinispan.interceptors.InvocationContextInterceptor]
(MemcachedServerWorker-2-1) ISPN000136: Execution error:
org.infinispan.loaders.CacheLoaderException: SQL error while fetching stored entry with
key: ByteArrayKey{data=ByteArray{size=10, hashCode=14c4b664, array=0x034f402400000000..}},
lockingKey: 8A09AJAAAAAAAAA==
[java] at
org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.readStoredEntry(JdbcStringBasedCacheStore.java:395)
[java] at
org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.loadLockSafe(JdbcStringBasedCacheStore.java:322)
[java] at
org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.loadLockSafe(JdbcStringBasedCacheStore.java:87)
[java] at
org.infinispan.loaders.LockSupportCacheStore.load(LockSupportCacheStore.java:130)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.CacheLoaderInterceptor.loadIfNeeded(CacheLoaderInterceptor.java:130)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.CacheLoaderInterceptor.visitPutKeyValueCommand(CacheLoaderInterceptor.java:79)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.EntryWrappingInterceptor.invokeNextAndApplyChanges(EntryWrappingInterceptor.java:188)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:137)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPutKeyValueCommand(OptimisticLockingInterceptor.java:108)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:133)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:61)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:214)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:152)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:115)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:107)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:67)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:61)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:318)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:919)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at org.infinispan.CacheImpl.put(CacheImpl.java:633)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at org.infinispan.CacheImpl.put(CacheImpl.java:625)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.AbstractDelegatingCache.put(AbstractDelegatingCache.java:114)
[infinispan-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.server.core.AbstractProtocolDecoder.put(AbstractProtocolDecoder.scala:187)
[infinispan-server-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.server.core.AbstractProtocolDecoder.decodeValue(AbstractProtocolDecoder.scala:141)
[infinispan-server-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.server.core.AbstractProtocolDecoder.decode(AbstractProtocolDecoder.scala:71)
[infinispan-server-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.server.core.AbstractProtocolDecoder.decode(AbstractProtocolDecoder.scala:44)
[infinispan-server-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.jboss.netty.handler.codec.replay.CustomReplayingDecoder.callDecode(CustomReplayingDecoder.java:250)
[infinispan-server-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.jboss.netty.handler.codec.replay.CustomReplayingDecoder.messageReceived(CustomReplayingDecoder.java:223)
[infinispan-server-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.infinispan.server.core.AbstractProtocolDecoder.messageReceived(AbstractProtocolDecoder.scala:351)
[infinispan-server-core-5.1.0-SNAPSHOT.jar:]
[java] at
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)
[netty-3.2.5.Final.jar:]
[java] at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
[netty-3.2.5.Final.jar:]
[java] at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
[netty-3.2.5.Final.jar:]
[java] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
[netty-3.2.5.Final.jar:]
[java] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)
[netty-3.2.5.Final.jar:]
[java] at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)
[netty-3.2.5.Final.jar:]
[java] at
org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)
[netty-3.2.5.Final.jar:]
[java] at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
[netty-3.2.5.Final.jar:]
[java] at
org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
[netty-3.2.5.Final.jar:]
[java] at
org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44)
[netty-3.2.5.Final.jar:]
[java] at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[:1.6.0_21]
[java] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[:1.6.0_21]
[java] at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
[java] Caused by: com.sybase.jdbc4.jdbc.SybSQLException: Error converting characters
into server's character set. Some character(s) could not be converted.
[java] at com.sybase.jdbc4.tds.Tds.a(Unknown Source)
[java] at com.sybase.jdbc4.tds.Tds.nextResult(Unknown Source)
[java] at com.sybase.jdbc4.jdbc.ResultGetter.nextResult(Unknown Source)
[java] at com.sybase.jdbc4.jdbc.SybStatement.nextResult(Unknown Source)
[java] at com.sybase.jdbc4.jdbc.SybStatement.nextResult(Unknown Source)
[java] at com.sybase.jdbc4.jdbc.SybStatement.queryLoop(Unknown Source)
[java] at com.sybase.jdbc4.jdbc.SybStatement.executeQuery(Unknown Source)
[java] at com.sybase.jdbc4.jdbc.SybPreparedStatement.executeQuery(Unknown Source)
[java] at
org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
[java] at
org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.readStoredEntry(JdbcStringBasedCacheStore.java:387)
[java] ... 54 more
{code}
Normal string keys (non-ByteArrayKey) can be stored/retrieved successfully.
This exception can be seen in this run:
https://hudson.qa.jboss.com/hudson/view/EDG6/view/EDG-QE/job/edg-60-jdbc-...
(there are also other issues in the run but these are related to binary cache stores,
there will be perhaps another issue created for them)
Artifacts of this hudson job contain server.log with TRACE level for infinispan.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira