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

Ask Your Question
0

Internal error failed to removeTemplate

Hi all!

We have the next polling container:

<os-events:polling-container id="almacenadorEvaluacionesXMLWorkerContainer" giga-space="gigaSpaceEvent" concurrent-consumers="4" max-concurrent-consumers="8">
    <os-events:tx-support tx-manager="transactionManager"/>
    <os-core:template>
        <bean class="modelo.impl.EvaluacionXML"/>
    </os-core:template>
    <os-events:listener>
        <os-events:annotation-adapter>
            <os-events:delegate ref="almacenadorEvaluacionesXMLWorker" />
        </os-events:annotation-adapter>
    </os-events:listener>
</os-events:polling-container>
  1. For some reason the GSM is registering and removing GSCs:

May 27, 2009 9:24:21 AM INFO [org.jini.rio.monitor.feedback]: Registered new GSC - [Grid Service Container pol/192.168.1.146], count [10]

May 27, 2009 9:29:24 AM INFO [org.jini.rio.monitor.feedback]: Registered new GSC - [Grid Service Container pol/192.168.1.146], count [11]

May 27, 2009 9:29:43 AM INFO [org.jini.rio.monitor]: GSC [Grid Service Container pol/192.168.1.146] removed, count now [10]

May 27, 2009 9:34:02 AM INFO [org.jini.rio.monitor.feedback]: Registered new GSC - [Grid Service Container pol/192.168.1.146], count [11]

May 27, 2009 9:34:13 AM INFO [org.jini.rio.monitor]: GSC [Grid Service Container pol/192.168.1.146] removed, count now [10]

May 27, 2009 9:35:43 AM INFO [org.jini.rio.monitor]: GSC [Grid Service Container pol/192.168.1.146] removed, count now [9]

May 27, 2009 9:38:11 AM INFO [org.jini.rio.monitor.feedback]: Registered new GSC - [Grid Service Container pol/192.168.1.146], count [10]

May 27, 2009 9:38:36 AM INFO [org.jini.rio.monitor]: GSC [Grid Service Container pol/192.168.1.146] removed, count now [9]

  1. And GSCs are throwing:

May 27, 2009 10:10:22 AM SEVERE [com.gigaspaces.core.engine]: internal error failed to removeTemplate: com.j_spaces.core.sadapter.SAException: com.gigaspaces.datasource.DataSourceException: Failed to execute bulk operation, latest object [[Objeto de tipo: [class modelo.impl.EvaluacionXML] identificador: [-4751821898669331063]] modelo.impl.EvaluacionXML@73ea5116] at com.j_spaces.sadapter.datasource.DataAdapter.updateEntry(DataAdapter.java:839) at com.j_spaces.core.cache.CacheManager.updateEntry(CacheManager.java:1093) at com.j_spaces.core.JSpaceEngine.updateEntrySA(JSpaceEngine.java:6261) at com.j_spaces.core.JSpaceEngine.performUpdateTemplateOnEntryCoreSA(JSpaceEngine.java:5776) at com.j_spaces.core.JSpaceEngine.performTemplateOnEntryCoreSA_impl(JSpaceEngine.java:5517) at com.j_spaces.core.JSpaceEngine.performTemplateOnEntryCoreSA(JSpaceEngine.java:5377) at com.j_spaces.core.JSpaceEngine.performTemplateOnEntryXtnAwareSA(JSpaceEngine.java:4844) at com.j_spaces.core.JSpaceEngine.performTemplateOnEntrySA(JSpaceEngine.java:4629) at com.j_spaces.core.JSpaceEngine.getEntryByIdAndOperateSA(JSpaceEngine.java:4001) at com.j_spaces.core.JSpaceEngine.getMatchedEntryAndOperateSA(JSpaceEngine.java:3598) at com.j_spaces.core.server.processor.Processor.handleDirectUpdateSA(Processor.java:444) at com.j_spaces.core.JSpaceEngine.update(JSpaceEngine.java:2235) at com.j_spaces.core.JSpaceEngine.update(JSpaceEngine.java:2085) at com.j_spaces.core.JSpaceEngine.update(JSpaceEngine.java:2066) at com.j_spaces.core.JSpaceEngine.updateOrWrite(JSpaceEngine.java:2120) at com.j_spaces.core.JSpaceEngine.updateOrWrite(JSpaceEngine.java:2102) at com.j_spaces.core.JSpaceImpl.updateOrWrite(JSpaceImpl.java:1600) at com.j_spaces.core.JSpaceImpl.update(JSpaceImpl.java:1504) at sun.reflect.GeneratedMethodAccessor282.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.gigaspaces.lrmi.LRMIRuntime.invoked(LRMIRuntime.java:381) at com.gigaspaces.lrmi.nio.Pivot.consumeAndHandleRequest(Pivot.java:371) at com.gigaspaces.lrmi.nio.Pivot.handleRequest(Pivot.java:459) at com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask.run(Pivot.java:149) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Caused by: com.gigaspaces.datasource.DataSourceException: Failed to execute bulk operation, latest object [[Objeto de tipo: [class modelo.impl.EvaluacionXML] identificador: [-4751821898669331063]] modelo.impl.EvaluacionXML@73ea5116] at org.openspaces.persistency.hibernate.DefaultHibernateExternalDataSource.executeBulk(DefaultHibernateExternalDataSource.java:125) at com.j_spaces.sadapter.datasource.DataStorage.executeBulk(DataStorage.java:415) at com.j_spaces.sadapter.datasource.DataAdapter.execute(DataAdapter.java:675) at com.j_spaces.sadapter.datasource.DataAdapter.update(DataAdapter.java:703) at com.j_spaces.sadapter.datasource.DataAdapter.updateEntry(DataAdapter.java:830) ... 30 more Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87) at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222) at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1030) at org.hibernate.action.CollectionRemoveAction.execute(CollectionRemoveAction.java:88) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:169) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at org.openspaces.persistency.hibernate.DefaultHibernateExternalDataSource.executeBulk(DefaultHibernateExternalDataSource.java:122) ... 34 more Caused by: java.sql.BatchUpdateException: Batch entry 0 update af.af_evaluacion_xml_alerta set evaluacion_xml_id=null where evaluacion_xml_id=-4751821898669331063 was aborted. Call getNextException to see the cause. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2396) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1257) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:334) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2455) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeBatch(DelegatingPreparedStatement.java:231) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246) ... 48 more

This is the worker implementation:

@SpaceDataEvent
public EvaluacionXML objProcessed(EvaluacionXML entry) {
 evaluacionesXMLSpace.write(entry);     
     return null;
}

Using: Gigaspaces XAP 6.6.3 b 3210 JDK 1.5.0

Thanks in advance...

Edited by: Jorge Mario Ulloa Marin on May 27, 2009 5:23 PM

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3107]{quote}

asked 2009-05-27 17:20:49 -0600

nullcipher2 gravatar image

updated 2013-08-08 09:52:00 -0600

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

This sounds as a CPU / Memory utilization problem.
Can you reproduce the problem? Or does it happen in sporadic manner?
Shay

answered 2009-05-28 07:43:07 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Shay:

It does happen in sporadic manner. We think about 13 readMultiples the system does against a clustered space is causing the problem.

I limited each readMultiple to read 200 objects, and the space has about 200000 objects the readMultiple´s uses for matching.

Thanks.

nullcipher2 gravatar image nullcipher2  ( 2009-05-28 09:58:04 -0600 )edit

The problems seems to be related to update data , not to reading data.

Are you updating data via the Mirror or directly via EDS?

If a readMultiple might return large data set , you should use the GSIterator.

Shay

shay hassidim gravatar image shay hassidim  ( 2009-05-28 13:47:20 -0600 )edit

But I think the readMultiple operations are causing the CPU/Memory issues( I guess due to some not indexed fileds), so, the eventSpace fails...., it´s not clear for me why the "Internal error failed to removeTemplate" is showing and the cause is the SQL Error, the eventSpace is not persistent.

The readMultiple calls are limited to 200 objects, and the space has about 200K objects for matching.

================================

I´m using EDS, I don´t know why GS is updating the object, maybe the transaction manager is retrying to do some task?:

<os-events:polling-container id="almacenadorEvaluacionesXMLWorkerContainer" giga-space="gigaSpaceEvent" concurrent-consumers="4" max-concurrent-consumers="8">
<os-events:tx-support tx-manager="transactionManager"/>
<os-core:template>
<bean class="modelo.impl.EvaluacionXML"/>
</os-core:template>
<os-events:listener>
<os-events:annotation-adapter>
<os-events:delegate ref="almacenadorEvaluacionesXMLWorker" />
</os-events:annotation-adapter>
</os-events:listener>
</os-events:polling-container>

@SpaceDataEvent
public EvaluacionXML objProcessed(EvaluacionXML entry) {
evaluacionesXMLSpace.write(entry);
return null;
}

nullcipher2 gravatar image nullcipher2  ( 2009-05-28 16:27:58 -0600 )edit

Hi Shay:

I´m generating the UUID(SpaceId) for the objects in the space as follows:

    Uuid uid = UuidFactory.generate();

    return uid.getLeastSignificantBits();

Do you think, is there a possibility the uuid be the same, suppose 4+ of concurrent transactions ...

What is the best strategy for generate it?

The issue is: One object with UUID(SpaceId) X was wrote to the space, then other object with the same UUID(SpaceId) try to update the object with the same UUID and due to a bad hibernate mapping the second object fails in the updating process.

Thanks

nullcipher2 gravatar image nullcipher2  ( 2009-05-29 10:42:03 -0600 )edit

Why not using the ID generator we are using with pet clinic?
Check out openspaces.org petclinic example.

Shay

shay hassidim gravatar image shay hassidim  ( 2009-05-29 18:09:19 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2009-05-27 17:20:49 -0600

Seen: 74 times

Last updated: May 28 '09