Static weaving issue? New object not persisted

View: New views
4 Messages — Rating Filter:   Alert me  

Static weaving issue? New object not persisted

by Jan Vissers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry - hit sent far to early. Trying it again

Hi,

I've noticed (at least one) issue with static weaving, using
EclipseLinkM6. The issue is with a OneToMany mapping as stated here:

public class IndustrialFamily extends BaseEntity {
...
  @OneToMany(mappedBy = "industrialFamily", cascade = PERSIST)
  private List<DisplayedFamilyCharacteristic>
displayedFamilyCharacteristics = new
ArrayList<DisplayedFamilyCharacteristic>();
...

  public void addDisplayCharacteristic(DisplayedFamilyCharacteristic
displayCharacteristic) {
     displayCharacteristic.setIndustrialFamily(this);
     displayedFamilyCharacteristics.add(displayCharacteristic);
  }

The other end is mapped like:


public class DisplayedFamilyCharacteristic extends BaseEntity {
...
  @ManyToOne
  @JoinColumn(name = "family_id", referencedColumnName = "ID")
  private IndustrialFamily industrialFamily;



In our code we call this operation on the IndustrialFamily class:

  addDisplayCharacteristic(...);

With statically woven classes, no object is persisted. When we build our
app without static weaving, everything works beautifully.

Any ideas why this happening.
Thanks,
Jan.




_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Static weaving issue? New object not persisted

by James Sutherland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Very odd.

When you don't use static weaving, are you using dynamic weaving or no weaving?
Do any errors occur during weaving or anywhere?

It may have something to do with change tracking, try setting "eclipselink.weaving.changetracking" to false to test if this is the case.

It may have something to do with the variable init, try moving this to the constructor to see if it changes things.


Jan Vissers wrote:
Sorry - hit sent far to early. Trying it again

Hi,

I've noticed (at least one) issue with static weaving, using
EclipseLinkM6. The issue is with a OneToMany mapping as stated here:

public class IndustrialFamily extends BaseEntity {
...
  @OneToMany(mappedBy = "industrialFamily", cascade = PERSIST)
  private List<DisplayedFamilyCharacteristic>
displayedFamilyCharacteristics = new
ArrayList<DisplayedFamilyCharacteristic>();
...

  public void addDisplayCharacteristic(DisplayedFamilyCharacteristic
displayCharacteristic) {
     displayCharacteristic.setIndustrialFamily(this);
     displayedFamilyCharacteristics.add(displayCharacteristic);
  }

The other end is mapped like:


public class DisplayedFamilyCharacteristic extends BaseEntity {
...
  @ManyToOne
  @JoinColumn(name = "family_id", referencedColumnName = "ID")
  private IndustrialFamily industrialFamily;



In our code we call this operation on the IndustrialFamily class:

  addDisplayCharacteristic(...);

With statically woven classes, no object is persisted. When we build our
app without static weaving, everything works beautifully.

Any ideas why this happening.
Thanks,
Jan.

Re: Static weaving issue? New object not persisted

by Jan Vissers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Indeed - setting 'eclipselink.weaving.changetracking' to false seems to
resolve the issue. Can you explain how this setting influences
EclipseLink to make this case work?

Thanks,
-J.

On Mon, 2008-06-23 at 08:13 -0700, James Sutherland wrote:

> Very odd.
>
> When you don't use static weaving, are you using dynamic weaving or no
> weaving?
> Do any errors occur during weaving or anywhere?
>
> It may have something to do with change tracking, try setting
> "eclipselink.weaving.changetracking" to false to test if this is the case.
>
> It may have something to do with the variable init, try moving this to the
> constructor to see if it changes things.
>
>
>
> Jan Vissers wrote:
> >
> > Sorry - hit sent far to early. Trying it again
> >
> > Hi,
> >
> > I've noticed (at least one) issue with static weaving, using
> > EclipseLinkM6. The issue is with a OneToMany mapping as stated here:
> >
> > public class IndustrialFamily extends BaseEntity {
> > ...
> >   @OneToMany(mappedBy = "industrialFamily", cascade = PERSIST)
> >   private List<DisplayedFamilyCharacteristic>
> > displayedFamilyCharacteristics = new
> > ArrayList<DisplayedFamilyCharacteristic>();
> > ...
> >
> >   public void addDisplayCharacteristic(DisplayedFamilyCharacteristic
> > displayCharacteristic) {
> >      displayCharacteristic.setIndustrialFamily(this);
> >      displayedFamilyCharacteristics.add(displayCharacteristic);
> >   }
> >
> > The other end is mapped like:
> >
> >
> > public class DisplayedFamilyCharacteristic extends BaseEntity {
> > ...
> >   @ManyToOne
> >   @JoinColumn(name = "family_id", referencedColumnName = "ID")
> >   private IndustrialFamily industrialFamily;
> >
> >
> >
> > In our code we call this operation on the IndustrialFamily class:
> >
> >   addDisplayCharacteristic(...);
> >
> > With statically woven classes, no object is persisted. When we build our
> > app without static weaving, everything works beautifully.
> >
> > Any ideas why this happening.
> > Thanks,
> > Jan.
> >
>
>
> -----
> ---
> http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
> http://www.eclipse.org/eclipselink/
>  EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
> TopLink
> Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink ,
> http://wiki.oracle.com/page/TopLink TopLink
> Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
> http://www.nabble.com/EclipseLink-f26430.html EclipseLink
> Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Static weaving issue? New object not persisted

by James Sutherland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That narrows it down.  I don't know why it is occurring yet.

Could you include the code you use to persist the object.  Also try enabling changetracking again and move the variable init to the constructor.


Jan Vissers wrote:
Hi,

Indeed - setting 'eclipselink.weaving.changetracking' to false seems to
resolve the issue. Can you explain how this setting influences
EclipseLink to make this case work?

Thanks,
-J.

On Mon, 2008-06-23 at 08:13 -0700, James Sutherland wrote:
> Very odd.
>
> When you don't use static weaving, are you using dynamic weaving or no
> weaving?
> Do any errors occur during weaving or anywhere?
>
> It may have something to do with change tracking, try setting
> "eclipselink.weaving.changetracking" to false to test if this is the case.
>
> It may have something to do with the variable init, try moving this to the
> constructor to see if it changes things.
>
>
>
> Jan Vissers wrote:
> >
> > Sorry - hit sent far to early. Trying it again
> >
> > Hi,
> >
> > I've noticed (at least one) issue with static weaving, using
> > EclipseLinkM6. The issue is with a OneToMany mapping as stated here:
> >
> > public class IndustrialFamily extends BaseEntity {
> > ...
> >   @OneToMany(mappedBy = "industrialFamily", cascade = PERSIST)
> >   private List<DisplayedFamilyCharacteristic>
> > displayedFamilyCharacteristics = new
> > ArrayList<DisplayedFamilyCharacteristic>();
> > ...
> >
> >   public void addDisplayCharacteristic(DisplayedFamilyCharacteristic
> > displayCharacteristic) {
> >      displayCharacteristic.setIndustrialFamily(this);
> >      displayedFamilyCharacteristics.add(displayCharacteristic);
> >   }
> >
> > The other end is mapped like:
> >
> >
> > public class DisplayedFamilyCharacteristic extends BaseEntity {
> > ...
> >   @ManyToOne
> >   @JoinColumn(name = "family_id", referencedColumnName = "ID")
> >   private IndustrialFamily industrialFamily;
> >
> >
> >
> > In our code we call this operation on the IndustrialFamily class:
> >
> >   addDisplayCharacteristic(...);
> >
> > With statically woven classes, no object is persisted. When we build our
> > app without static weaving, everything works beautifully.
> >
> > Any ideas why this happening.
> > Thanks,
> > Jan.