cancel
Showing results for 
Search instead for 
Did you mean: 

Out of memory error importing a JPA Entity in WebDynpro Project

Former Member
0 Kudos

Hi All!

We are having problems importing JPA entities in a WebDynPro project, this is our escenario.

We have two entities, entity A that has a ManyToOne relationship with entity B and at the same time entity B has a OneToMany relationship with entity A. When in the controller context we try to create a node usign a model binding to Entity A we got an Out of memory error from NetWeaver DS. Trying to figure out the problem we identified that in the model that we imported we got the following.

Entity A

Entity B

Entity A

Entity B

and so on....... without and end

What are we doing wrong? Or how can we avoid these behavior?

Regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

As of my knowledge is consider its going to a chain reaction,so you are getting out of memory error.

Think that why cant you create 2 more entities one for A and one for B and use them.

Do you mean Entity is a context node.Explain your scenario more clearly.

Regards

Kalyan

Former Member
0 Kudos

Hi Kaylan:

Thanks for your reply. You are rigth about the error that we are getting. This is our scenario.

We have a ejb that in some of his method uses the entity Lote, and this entity has a relationship with entity Categoria. When we import the EJB using the model importer netweaver imports the EJB methods and the entities that they use.

So after doing this besides the ejb's methods we got these two entities that are the ones that are generating the error, when we try to create a context node using the Categoria entity.

@Entity

@Table(name="TB_LOTE")

public class Lote implements Serializable {

@EmbeddedId

private Lote.PK pk;

@ManyToOne

@JoinColumn(name="CO_CATEGORIALOTE")

private Categoria coCategorialote;

@Embeddable

public static class PK implements Serializable {

@Column(name="CO_LOTE")

private String coLote;

@Column(name="CO_ORDENFABRICACION")

private String coOrdenfabricacion2;

^ this.coOrdenfabricacion2.hashCode();

}

}

@Entity

@Table(name="TB_CATEGORIA")

public class Categoria implements Serializable {

@Id

@Column(name="CO_CATEGORIA")

private String coCategoria;

@OneToMany(mappedBy="coCategorialote")

private Set<Lote> tbLoteCollection;

}

Regards,

Jose Arango

Former Member
0 Kudos

Just in case some else has this problem. We took out all the bidirectional relationships, we are just working with unidirectional relationships.