Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

IBM Data Cache: Is there a size limit for the values in a map?

310000030F gravatar image
Question by JHF  (152) | Apr 18, 2016 at 01:10 PM ibmclouddatacacheserializationeclipselinkjpa_2.1size_limit

I'm asking this question, because I can't find anything in the docs: https://new-console.ng.bluemix.net/docs/services/DataCache/index.html#datac001

As far as I understand IBM Data Cache (ObjectGrid) is a simple distributed storage that consists of maps, where each map consists of key/value pairs. Since both the key and value can be any Object (java.lang.Object), they just need to be Serializable (implement java.io.Serializable). However, I wonder if there's a size limit for the value of an entry in the map?

In our Liberty Java application we experience de-serialization issues for some of the maps we created. By inspecting the values - via the IBM Bluemix Dashboard - which are stored in Data Cache , it seems like that some of the objects are not completely serialized. For example, there's a cut after 8182 characters, which seems to be close to 8KB (8192 byte) limit. I don't know if this is a limit of the dashboard, that it can't show more than that for a value in a map, or if that's the limit of what can be stored in a map entry? Unfortunately there's (at least I don't know) any other way to inspect the contents of a map in the Data Cache.

When we write to the map via

 map = objectGrid.getSession().getMap(mapName);
 map.upsert(key, value);

no exception is thrown. If there was a size limit of how big the values in a map can be, I would expect an exception here when you write to the map. But there's none. However, when we try to read from the map again via

 map = objectGrid.getSession().getMap(mapName);
 value = map.get(key);
 

a de-serialization exception is thrown with the following cause:

 2016-04-17T23:00:39.53+0200 [App/0]      ERR [ERROR   ] cause: 
     2016-04-17T23:00:39.53+0200 [App/0]      ERR Metadata for typeId 97; domainHashCode=99 could not be found.  The metadata may not have yet replicated from a foreign domain.
     2016-04-17T23:00:39.53+0200 [App/0]      ERR [err] com.ibm.websphere.objectgrid.TransactionException: transaction marked rollback only, see caused by exception
     2016-04-17T23:00:39.62+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.SessionImpl.mapPostInvoke(SessionImpl.java:3729)
     2016-04-17T23:00:39.62+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.ObjectMapImpl.postInvoke(ObjectMapImpl.java:883)
     2016-04-17T23:00:39.62+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.ObjectMapImpl.get(ObjectMapImpl.java:476)
     2016-04-17T23:00:39.62+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.ObjectMapImpl.get(ObjectMapImpl.java:411)
     ...
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err] Caused by: 
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err] com.ibm.websphere.objectgrid.ObjectGridRuntimeException: Metadata for typeId 97; domainHashCode=99 could not be found.  The metadata may not have yet replicated from a foreign domain.
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.plugins.io.dataobject.values.ValueDataImpl.getObject(ValueDataImpl.java:391)
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.DiffMap.get(DiffMap.java:1061)
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.ObjectMapImpl.get(ObjectMapImpl.java:451)
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err]     ... 105 more
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err] Caused by: 
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err] com.ibm.ws.objectgrid.MissingSerializationInfoException: Metadata for typeId 97; domainHashCode=99 could not be found.  The metadata may not have yet replicated from a foreign domain.
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.SerializerFactory.getDescriptorFromID(SerializerFactory.java:610)
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.GenericClassSerializer.deserializeFieldsToObject(GenericClassSerializer.java:318)
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.javaStream.XDFObjectInputStreamV2Impl.defaultReadObject(XDFObjectInputStreamV2Impl.java:70)
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.javaStream.GenericJavaSerializer2.deserializeObject(GenericJavaSerializer2.java:242)
     2016-04-17T23:00:39.72+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.javaStream.GenericJavaSerializer2.deserializeFieldToObject(GenericJavaSerializer2.java:269)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.GenericClassSerializer.deserializeFieldsToObject(GenericClassSerializer.java:307)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.GenericClassSerializer.deserializeObject(GenericClassSerializer.java:227)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.CheckTypeSerializer.deserializeObject(CheckTypeSerializer.java:82)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.GenericClassSerializer.deserializeFieldToObject(GenericClassSerializer.java:376)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.GenericClassSerializer.deserializeFieldsToObject(GenericClassSerializer.java:286)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.GenericClassSerializer.deserializeObject(GenericClassSerializer.java:227)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.CheckTypeSerializer.deserializeObject(CheckTypeSerializer.java:82)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.GenericClassSerializer.deserializeFieldToObject(GenericClassSerializer.java:376)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.GenericClassSerializer.deserializeFieldsToObject(GenericClassSerializer.java:286)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.GenericClassSerializer.deserializeObject(GenericClassSerializer.java:227)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.CheckTypeSerializer.deserializeObject(CheckTypeSerializer.java:82)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.serializers.collections.AbstractListSerializer.deserializeObject(AbstractListSerializer.java:223)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.xdf.XDFSerializerPlugin.inflateDataObject(XDFSerializerPlugin.java:363)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     at com.ibm.ws.objectgrid.plugins.io.dataobject.values.ValueDataImpl.getObject(ValueDataImpl.java:383)
     2016-04-17T23:00:39.73+0200 [App/0]      ERR [err]     ... 107 more
 



People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

3 answers

  • Sort: 
310000030F gravatar image
Accepted answer

Answer by JHF (152) | Jul 17, 2016 at 05:05 PM

We finally found the source of the exception com.ibm.ws.objectgrid.MissingSerializationInfoException: Metadata for typeId 97; domainHashCode=99 could not be found when serializing/de-serializing to/from IBM Data Cache in our Liberty Application.

And the cause of this exception is really nasty one and was hard to spot!

We recently migrated our IBM Liberty application from the JPA 2.0 feature (which uses OpenJPA) to the JPA 2.1 feature, which uses EclipseLink as the persistence layer now. After that we were experiencing the above mentioned exception for some of the objects we store in the Data Cache (ObjectGrid).

The problematic object to serialize/deserialize contains (among others) the following java.util.List field:

Simplified Example:

 public class MyClass extends BaseClass implements Serializable {
 ...
     private List<OtherSerializableClass> myList;
     ...
     public MyClass(MyJPAEntity entity) {
         ...
         myList = entity.getSomeElements();
         ...
     }
 ...
 }

The hard thing is, that the exception complaining about typeId 97; domainHashCode=99 doesn't give a clue about which class within the object hierarchy to serialize causes the problem. And the last thing we suspected is that the java.util.List is causing the problem. Well, java.util.List is just the interface, but it turns out that EclipseLink uses a org.eclipse.persistence.internal.indirection.jdk8.IndirectList for a @ElementCollection JPA entity field.

And it turned out that exactly this org.eclipse.persistence.internal.indirection.jdk8.IndirectList class is causing the serialization/deserialization issues with IBM Data Cache service on IBM Bluemix. If we convert it explicitely into an java.util.ArrayList for example, the problem is gone and serialization/deserialization works fine again.

Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
2700042H9U gravatar image

Answer by 2H9U_Kenny_C (1) | Apr 18, 2016 at 02:36 PM

Can you please go to the VCAP environment and find which ecaas collective is hosting your app. You should see something like the following : ecaasXXX where XXX is the collective number to indicate which caching server is hosting your application.

Comment

People who like this

  0   Show 3   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
310000030F gravatar image JHF (152)   Apr 18, 2016 at 05:49 PM 0
Share

It's ecaas4.

060000D48R gravatar image Abelard Chow (121) JHF (152)   Apr 18, 2016 at 08:40 PM 0
Share

Ecaas4 US or LON? Can you give us the full host name please? Thanks

310000030F gravatar image JHF (152) Abelard Chow (121)   Apr 19, 2016 at 02:11 AM 0
Share

https://ecaas4.eu-gb.bluemix.net

060000D48R gravatar image

Answer by Abelard Chow (121) | Apr 18, 2016 at 04:20 PM

Hi JHF,

There is no size limit for the values in a map, except the available memory resource allocated to the grid. But that number is much bigger than 8k.

On the other hand, we don't recommend store big objects in Data Cache. Data Cache is for caching and performance improvement purpose. Storing big objects in Data Cache will increase the data transfer time, which defeat the purpose of a caching solution.

Thanks

Comment

People who like this

  0   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
310000030F gravatar image JHF (152)   Apr 18, 2016 at 05:54 PM 0
Share

The values we want to store are a few hundred kbyte... Just the results of some expensive DB queries, that can be cached for a while. It's not like we want to store tens or hundreds of megabytes in a value.

Follow this question

84 people are following this question.

Answers

Answers & comments

Related questions

ClassNotFoundException: com.ibm.ws.Transaction.TransactionManagerFactory 3 Answers

Get 500 error trying to insert into IBM Data Cache on Bluemix using POST REST API 1 Answer

How to use DataCache service on mobile 1 Answer

Data Cache Cleanup 1 Answer

Deploying app to Bluemix using the liberty builpack and Bluemix for Eclipse tools 5 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges