Hello Ivy Team,

In my project, I had to switch from the default Eager loading to the Lazy loading of the Entity classes. The reason was that the queries were not optimized. Now I have the following problem, every time I try to inspect the variables in debug mode, the Designer is throwing errors and it is almost impossible for debugging:

alt text

Best Regards, Yordan Yunchov

asked 21.12.2016 at 09:19

Stelt0's gravatar image

Stelt0
(suspended)
accept rate: 12%

edited 19.01.2017 at 09:43

Flavio%20Sadeghi's gravatar image

Flavio Sadeghi ♦♦
(suspended)


[Edit]: The Bug 'Label Job has encountered a problem' is fixed with 6.5. We return null, since the below explanation is still true.

Lazy evaluation of entity beans is not supported with the ivy persistency.

As described in the documentation, ivy persistency always works with unmanaged entity beans. Lazy loading is only supported with managed entity beans. A beans is managed as long the referenced session (link to the db/transaction) is open - means the entity is managed (i.e. cached) in the session.

How to solve:

Example: Table Company has a 1:n relation to Invoices.

  • First question: is the lazy loading required? Do the Company entity need a list of all invoices or can it be replaced/reduced to the @ManyToOne relation on the Invoice entity?
    To get the list of all invoices of a company a repositoy method has to be implemented, e.g. InvoiceRepository.readAllOfCompany(Company c) : List< Invoices >;
  • Write own repository method and open/close the session inside this method. As long the session is open, as long the entiries are managed and lazy loading is supported. Always ensure with a try-finally block that the session gets closed. Otherwise, the connection to the database remains open and the allowed number of connections is limited. An example could be find here.
link

answered 21.12.2016 at 15:49

Flavio%20Sadeghi's gravatar image

Flavio Sadeghi ♦♦
(suspended)
accept rate: 75%

edited 19.01.2017 at 09:42

Hello @Flavio Sadeghi,

I agree about what you said.

However, from the perspective of an user, if I can inspect the variables in Debug mode, why I can't inspect them in Ivy designer process development mode? There is always a error thrown. For me it is a product bug. And it is a big one. Why throwing and error ? Why not showing null or whatever ? I am not able to inspect the rest of the "unmanaged" variables as well. No mater where I click I get an error. Best Regards, Yordan

(22.12.2016 at 09:31) Stelt0 Stelt0's gravatar image

Thanks for feedback. I will check that. Probably the debugview can not handle java proxy objects, which are ordinarily used when working with lazy-loading. We can/will fix that. You will hear from me here.

(22.12.2016 at 10:00) Flavio Sadeghi ♦♦ Flavio%20Sadeghi's gravatar image

Thanks a lot for addressing this issue ! Good luck ! :)

(22.12.2016 at 10:05) Stelt0 Stelt0's gravatar image

@Stelt0, We have fixed this bug for 6.5, which will be released very soon (probably tomorrow).

(19.01.2017 at 09:39) Flavio Sadeghi ♦♦ Flavio%20Sadeghi's gravatar image

Thanks a lot Flavio ! is it possible to provide some hot-fix jar(s) that will work with older versions 6.0. and 6.1 ?

(19.01.2017 at 12:25) Stelt0 Stelt0's gravatar image

We can fix it for 6.0. (6.1 not, since it is a Leading Edge version) Would this help?

(19.01.2017 at 12:28) Flavio Sadeghi ♦♦ Flavio%20Sadeghi's gravatar image
showing 5 of 6 show 1 more comments

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×78
×52
×37
×9
×6

Asked: 21.12.2016 at 09:19

Seen: 2,222 times

Last updated: 19.01.2017 at 12:28