Comments (3)
I can confirm this issue. I also have an object model that has some cycles,
mainly referencing parent relations. I was able to overcome the issue with
generating the RuntimeSchema (see below) but then I ran into issues when
serializing the data, since the recurring objects have not been detected as
references but have been serialized again and again. Is the lack of support for
cyclic object models a known limitation? Is it planned to support such
references? That would be great.
Regarding the runtime schema generation, here is what I did: I added a
getSchemaPlaceholder method to RuntimeSchema, which mainly duplicates the code
of getSchema, but returns directly the HasSchema<T> object. This object is then
used in RuntimeFieldObject's FieldFactories for MESSAGE and POJO, so that the
child schema is not fetched during creation of the parent schema. Thus the
creation is deferred and the stackoverflow does not occur. The drawback is that
the validation is also deferred and happens then during the serialization.
Original comment by [email protected]
on 19 Jan 2011 at 3:04
from protostuff-googlecode-exported.
Nice timing. I've been working on this the past few days.
This feature is now available on trunk.
Let me know if that works for you.
Take a look at http://code.google.com/p/protostuff/wiki/SerializingObjectGraphs
@tvanles Yep that's the route to go (w/c I took) to support cyclic
dependencies.
Thanks
Original comment by [email protected]
on 19 Jan 2011 at 5:08
- Changed state: Fixed
from protostuff-googlecode-exported.
I'll make a release soon. Would be good if you can verify.
Next on the roadmap (for next release) would be support for java.util.Map
Original comment by [email protected]
on 19 Jan 2011 at 5:17
from protostuff-googlecode-exported.
Related Issues (20)
- Would like support for repeated accessors with out "List" appeneded
- Enter one-line summary HOT 2
- getSchema() of java.util.Properties fails HOT 2
- optimize xml format
- Enum alias support
- YamlOutput bug on repeated message fields HOT 1
- Deserializing a message which is protostuff-runtime serialized and has custom class as field HOT 3
- Visual disturbance of @Deprecated annotation HOT 12
- Support for newing object instances on Android 4.3+ devices HOT 2
- ConcurrentLinkedDeque support HOT 1
- Produces uncompilable Java when a field is called "default" HOT 4
- 1.0.7 Build error: ProtoParserTest fails HOT 2
- protostuff-parser and protostuff-compiler disagree on required version of antlr
- Optimize ProtobufOuput for small nested messages (max size of 127) HOT 1
- How can I serialize a negative int32 to the protobuf format using zigzag encoding? HOT 2
- How to Ignore Array of Null Values in JSON
- enums_by_name does not seem to be working using maven plugin
- The value of DataInput.readByte() should not be eof-checked since that method throws EOFException HOT 1
- Wrong output path is generated in Windows for .java files HOT 3
- Unable to parse proto enum containing hex constants HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protostuff-googlecode-exported.