Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

QueryParameterException

When write POJOs to a persistent space,such error come out:

[gsc][2/6244] 2014-04-17 18:31:08,736 tradeSpace [1] SEVERE [com.gigaspaces.core.common] - com.j_spaces.core.exception.internal.EngineInternalSpaceException: com.j_spac es.core.sadapter.SAException: org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 1; Caused by: com.j_spaces.core.exception.internal.EngineInternalSpaceException: com.j_spaces.core.sadapter.SAException: org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 1 [gsc][2/6244] at com.gigaspaces.internal.server.space.SpaceEngine.write(SpaceEngine.java:836) [gsc][2/6244] at com.gigaspaces.internal.server.space.SpaceEngine.write(SpaceEngine.java:732) [gsc][2/6244] at com.gigaspaces.internal.server.space.SpaceEngine.updateOrWrite(SpaceEngine.java:2254) [gsc][2/6244] at com.gigaspaces.internal.server.space.SpaceEngine.updateOrWrite(SpaceEngine.java:2152) [gsc][2/6244] at com.gigaspaces.internal.server.space.SpaceImpl.updateOrWrite(SpaceImpl.java:666) [gsc][2/6244] at com.gigaspaces.internal.server.space.SpaceImpl.update(SpaceImpl.java:2025) [gsc][2/6244] at com.gigaspaces.internal.server.space.operations.WriteEntrySpaceOperation.execute(WriteEntrySpaceOperation.java:34) [gsc][2/6244] at com.gigaspaces.internal.server.space.operations.WriteEntrySpaceOperation.execute(WriteEntrySpaceOperation.java:20) [gsc][2/6244] at com.gigaspaces.internal.server.space.operations.SpaceOperationsExecutor.executeOperation(SpaceOperationsExecutor.java:77) [gsc][2/6244] at com.gigaspaces.internal.server.space.SpaceImpl.executeOperation(SpaceImpl.java:1832) [gsc][2/6244] at com.gigaspaces.internal.remoting.RemoteOperationsExecutorGigaspacesMethodinternalInvoke2.internalInvoke(Unknown Source) [gsc][2/6244] at com.gigaspaces.internal.reflection.fast.AbstractMethod.invoke(AbstractMethod.java:41) [gsc][2/6244] at com.gigaspaces.lrmi.LRMIRuntime.invoked(LRMIRuntime.java:464) [gsc][2/6244] at com.gigaspaces.lrmi.nio.Pivot.consumeAndHandleRequest(Pivot.java:561) [gsc][2/6244] at com.gigaspaces.lrmi.nio.Pivot.handleRequest(Pivot.java:662) [gsc][2/6244] at com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask.run(Pivot.java:196) [gsc][2/6244] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [gsc][2/6244] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [gsc][2/6244] at java.lang.Thread.run(Thread.java:662) [gsc][2/6244] Caused by: com.j_spaces.core.sadapter.SAException: org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 1 [gsc][2/6244] at com.gigaspaces.internal.sync.SynchronizationStorageAdapter.getEntry(SynchronizationStorageAdapter.java:575) [gsc][2/6244] at com.j_spaces.core.cache.CacheManager.getEntry(CacheManager.java:1493) [gsc][2/6244] at com.j_spaces.core.server.processor.Processor.insertEntryToSpace(Processor.java:299) [gsc][2/6244] at com.j_spaces.core.server.processor.Processor.insertToSpaceLoop(Processor.java:262) [gsc][2/6244] at com.j_spaces.core.server.processor.Processor.handleDirectWriteSA(Processor.java:194) [gsc][2/6244] at com.gigaspaces.internal.server.space.SpaceEngine.write(SpaceEngine.java:826) [gsc][2/6244] ... 18 more [gsc][2/6244] Caused by: org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Pos ition: 1 [gsc][2/6244] at org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterDescriptor(ParameterMetadata.java:81) [gsc][2/6244] at org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterExpectedType(ParameterMetadata.java:87) [gsc][2/6244] at org.hibernate.impl.AbstractQueryImpl.determineType(AbstractQueryImpl.java:444) [gsc][2/6244] at org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:416) [gsc][2/6244] at org.openspaces.persistency.hibernate.iterator.HibernateIteratorUtils.createQueryFromSQLQuery(HibernateIteratorUtils.java:45) [gsc][2/6244] at org.openspaces.persistency.hibernate.iterator.DefaultListQueryDataIterator.createIterator(DefaultListQueryDataIterator.java:147) [gsc][2/6244] at org.openspaces.persistency.hibernate.iterator.DefaultListQueryDataIterator.hasNext(DefaultListQueryDataIterator.java:106) [gsc][2/6244] at org.openspaces.persistency.hibernate.iterator.HibernateProxyRemoverIterator.hasNext(HibernateProxyRemoverIterator.java:53) [gsc][2/6244] at com.gigaspaces.datasource.SpaceDataSource.getById(SpaceDataSource.java:76) [gsc][2/6244] at com.gigaspaces.datasource.concurrentaccess.SharedIteratorSpaceDataSourceDecorator.getById(SharedIteratorSpaceDataSourceDecorator.java:169) [gsc][2/6244] at com.gigaspaces.internal.sync.SynchronizationStorageAdapter.getEntry(SynchronizationStorageAdapter.java:557) [gsc][2/6244] ... 23 more


It seems like being caused by a defect in HibernateIteratorUtils if (preparedValues != null) { for (int i = 0; i < preparedValues.length; i++) { query.setParameter(i, preparedValues[i]); } }

Please advice! Thanks My using version:gigaspaces-xap-premium-9.7.0-ga

My mapping file is like below:

<hibernate-mapping> <class name="com.ubs.oms.trading.common.bean.PersistedTrade"> <id name="oid" type="string" column="ID"> <generator class="assigned"/> </id> <property name="operationDate" type="date" column="OP_TIME"/> </class>

</hibernate-mapping>

My POJO is here :

@SpaceClass public class PersistedTrade { private String oid; private Date operationDate; private transient SourceTrade sourceTrade;

@SpaceId(autoGenerate = false)
@SpaceRouting
public String getOid() {
    return oid;
}

public void setOid(String oid) {
    this.oid = oid;
}

public Date getOperationDate() {
    return operationDate;
}

public void setOperationDate(Date operationDate) {
    this.operationDate = operationDate;
}

public SourceTrade getSourceTrade() {
    return sourceTrade;
}

public void setSourceTrade(SourceTrade sourceTrade) {
    this.sourceTrade = sourceTrade;
}

}

asked 2014-04-17 06:07:40 -0500

gavin gravatar image

updated 2014-04-17 06:19:56 -0500

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

How your POJO looks like?

How your POJO looks like?

answered 2014-04-17 06:12:50 -0500

shay hassidim gravatar image

updated 2014-04-17 06:28:13 -0500

edit flag offensive delete link more
0

Add SpaceExclude annotation to getSourceTrade

answered 2014-04-24 02:56:03 -0500

Ester gravatar image
edit flag offensive delete link more
0

Hi, I'm having similar problem. Any luck?

answered 2014-07-29 14:46:11 -0500

myth gravatar image
edit flag offensive delete link more
0

Hi thanks for your fast reply, and it looks like this:

@SpaceClass public class PersistedTrade { private String oid; private Date operationDate; private transient SourceTrade sourceTrade;

@SpaceId(autoGenerate = false)
@SpaceRouting
public String getOid() {
    return oid;
}

public void setOid(String oid) {
    this.oid = oid;
}

public Date getOperationDate() {
    return operationDate;
}

public void setOperationDate(Date operationDate) {
    this.operationDate = operationDate;
}

public SourceTrade getSourceTrade() {
    return sourceTrade;
}

public void setSourceTrade(SourceTrade sourceTrade) {
    this.sourceTrade = sourceTrade;
}

}

answered 2014-04-17 06:16:10 -0500

gavin gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-04-17 06:07:40 -0500

Seen: 879 times

Last updated: Jul 29 '14