Bug #57806 wrong interface member function type gives funny exception
Submitted: 28 Oct 2010 13:20 Modified: 23 Aug 2013 18:42
Reporter: Bernd Ocklin Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Cluster: Cluster/J Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.1 OS:Any
Assigned to: CPU Architecture:Any

[28 Oct 2010 13:20] Bernd Ocklin
Description:
When having a varchar column but interface for domain object' getter/setter is of type byte[] you will get this exception rather than a "interface incompatible" exception.

28.10.2010 15:09:06 com.mysql.clusterj.core.SessionImpl insert
SCHWERWIEGEND: Error executing getInsertOperation on table mytable.
com.mysql.clusterj.ClusterJException: Error executing getInsertOperation on table mytable. Caused by java.lang.IllegalArgumentException:JTie: java.nio.ByteBuffer's capacity is too small  for the mapped parameter; required: 1, found: 0.
        at com.mysql.clusterj.core.SessionImpl.insert(SessionImpl.java:303)
        at com.mysql.clusterj.core.SessionImpl.makePersistent(SessionImpl.java:274)
        at com.mysql.clusterj.core.SessionImpl.persist(SessionImpl.java:1074)
        at com.mysql.cluster.benchmark.tws.ClusterjLoad.clusterjInsert(ClusterjLoad.java:227)
        at com.mysql.cluster.benchmark.tws.ClusterjLoad.runClusterjInsert(ClusterjLoad.java:183)
        at com.mysql.cluster.benchmark.tws.ClusterjLoad.runOperations(ClusterjLoad.java:155)
        at com.mysql.cluster.benchmark.tws.TwsDriver.runOperations(TwsDriver.java:241)
        at com.mysql.cluster.benchmark.tws.TwsDriver.runSeries(TwsDriver.java:211)
        at com.mysql.cluster.benchmark.tws.TwsDriver.runLoads(TwsDriver.java:194)
        at com.mysql.cluster.benchmark.tws.TwsDriver.runTests(TwsDriver.java:185)
        at com.mysql.cluster.benchmark.tws.Driver.run(Driver.java:148)
        at com.mysql.cluster.benchmark.tws.TwsDriver.main(TwsDriver.java:53)
Caused by: java.lang.IllegalArgumentException: JTie: java.nio.ByteBuffer's capacity is too small  for the mapped parameter; required: 1, found: 0.
        at com.mysql.ndbjtie.ndbapi.NdbOperation.setValue(Native Method)
        at com.mysql.clusterj.tie.OperationImpl.setBytes(OperationImpl.java:234)
        at com.mysql.clusterj.core.metadata.AbstractDomainFieldHandlerImpl$4.operationSetValue(AbstractDomainFieldHandlerImpl.java:637)
        at com.mysql.clusterj.core.metadata.DomainFieldHandlerImpl.operationSetValue(DomainFieldHandlerImpl.java:308)
        at com.mysql.clusterj.core.metadata.AbstractDomainTypeHandlerImpl.operationSetNonPKValues(AbstractDomainTypeHandlerImpl.java:258)
        at com.mysql.clusterj.core.SessionImpl.insert(SessionImpl.java:289)
        ... 11 more
java.lang.IllegalArgumentException: JTie: java.nio.ByteBuffer's capacity is too small  for the mapped parameter; required: 1, found: 0.
        at com.mysql.ndbjtie.ndbapi.NdbOperation.setValue(Native Method)
        at com.mysql.clusterj.tie.OperationImpl.setBytes(OperationImpl.java:234)
        at com.mysql.clusterj.core.metadata.AbstractDomainFieldHandlerImpl$4.operationSetValue(AbstractDomainFieldHandlerImpl.java:637)
        at com.mysql.clusterj.core.metadata.DomainFieldHandlerImpl.operationSetValue(DomainFieldHandlerImpl.java:308)
        at com.mysql.clusterj.core.metadata.AbstractDomainTypeHandlerImpl.operationSetNonPKValues(AbstractDomainTypeHandlerImpl.java:258)
        at com.mysql.clusterj.core.SessionImpl.insert(SessionImpl.java:289)
        at com.mysql.clusterj.core.SessionImpl.makePersistent(SessionImpl.java:274)
        at com.mysql.clusterj.core.SessionImpl.persist(SessionImpl.java:1074)
        at com.mysql.cluster.benchmark.tws.ClusterjLoad.clusterjInsert(ClusterjLoad.java:227)
        at com.mysql.cluster.benchmark.tws.ClusterjLoad.runClusterjInsert(ClusterjLoad.java:183)
        at com.mysql.cluster.benchmark.tws.ClusterjLoad.runOperations(ClusterjLoad.java:155)
        at com.mysql.cluster.benchmark.tws.TwsDriver.runOperations(TwsDriver.java:241)
        at com.mysql.cluster.benchmark.tws.TwsDriver.runSeries(TwsDriver.java:211)
        at com.mysql.cluster.benchmark.tws.TwsDriver.runLoads(TwsDriver.java:194)
        at com.mysql.cluster.benchmark.tws.TwsDriver.runTests(TwsDriver.java:185)
        at com.mysql.cluster.benchmark.tws.Driver.run(Driver.java:148)
        at com.mysql.cluster.benchmark.tws.TwsDriver.main(TwsDriver.java:53)

How to repeat:
e.g. change interface to byte[] from String for a column in TWS.
[23 Jul 2013 18:42] Sveta Smirnova
Thank you for the report.

I don't receive any exception today, with 7.2.14, persistence is as follow:

import com.mysql.clusterj.annotation.PersistenceCapable;
import com.mysql.clusterj.annotation.PrimaryKey;

@PersistenceCapable(table = "test_table")
public interface TestTable {

	@PrimaryKey
	int getId();

	void setid(int id);

	byte[] getName();

	void setName(byte[] name);

}

Table definition:

CREATE  TABLE `test_table` (    `id` INT NOT NULL ,    `name` VARCHAR(45) NULL ,    PRIMARY KEY (`id`) )  ENGINE = ndbcluster;

Did I miss something? Can we consider this fixed?
[24 Aug 2013 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".