1

I'm using play! framework 1.2.4 on a project who passes objects from an external context (Flex actually) to a service. The gateway uses the cinnamon framework (http://www.spicefactory.org/pimento/) to handle AMF requests to be routed to services.

I thus receive detached objects, and I'm trying to avoid entering complex merging issues by simply calling:

JPA.em().merge(myObject)

It does the trick for simple objects, but when it comes to a more complex object, I run across the following error which simply shuts down the server (which is naughty)

Invalid access of stack red zone

Here is a simplified overview of my JPA mapping

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@DiscriminatorColumn(name = "templateType")
ProductTemplate extends GenericModel
 |- @OneToMany(mappedBy = "productTemplate", cascade = CascadeType.ALL)
 |  List<ProductTemplateLang> translations;
 |
 |  @MappedSuperclass
 |_ LayeredProductTemplate
     |
     | @Entity
     |_ Book
         |- @OneToMany(mappedBy = "book", cascade = CascadeType.ALL)
         |  List<BookPage> pages;

With

@Entity 
BookPage extends Model
 |- @OneToMany(mappedBy = "page", cascade = CascadeType.ALL)
 |  List<Layer> layers;

And

@Entity 
Layer extends Model
 |- @OneToMany(mappedBy = "layer", cascade = CascadeType.ALL)
 |  List<LayerLang> translations;

(I removed most of the properties) Can it be due to the fact the object I receive is too complex?

I'm trying to do everything by hand but also encounter a "Found two representations of same collection" which is kind of tricky to figure out...

Any help, thoughts, direction are greatly appreciated!

Thanks

fuz
  • 88,405
  • 25
  • 200
  • 352
Hervé Labas
  • 161
  • 1
  • 7

1 Answers1

0

For those interested, I had to merge everything manually to get my stuff to work. I still let this question unanswered in case a Play guru has an explanation / question to move forward with this kind of problem.

Cheers!

Hervé Labas
  • 161
  • 1
  • 7