Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » LAZY LOADING ONETOONE MANYTOONE(LAZY LOADING ONETOONE MANYTOONE)
icon9.gif  LAZY LOADING ONETOONE MANYTOONE [message #1211421] Tue, 26 November 2013 12:28 Go to next message
Carlos Curos is currently offline Carlos CurosFriend
Messages: 5
Registered: November 2013
Junior Member
Hi, we are working in a Java Project and we are optimizing it with weaving and lazy loading.

We have some problems with onetoone and manytoone annotations.

We have class Expedición and there are two atributes that we have activated lazy loading and as we see en log it seems that lazy loading it's not working.

the parameters are:

DatosSCC and LineasExpedicion, as you can see en the upoaded file , it is activaded lazy loading and cascadetype without cascade.refresh

If we see the uploaded log file, it's querying datossscc in line 17 and LineaExpedicion in line 23 .

Can we actívate more log to see whats it's happening, any idea?


Re: LAZY LOADING ONETOONE MANYTOONE [message #1211586 is a reply to message #1211421] Tue, 26 November 2013 14:15 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Set logging to finest and show the logs when the application is first deployed - the initialization messages EclipseLink prints off when processing your entities might tell more of what is going on, and finest logging might show what is triggering the queries. The lineasExpedicion mapping is OneToMany though, which is able to use lazy even without weaving, so I suspect something within your entities or the query itself (such as a fetch group, a batch fetch on the query, a toString method that accesses relationships etc) is causing it to be eagerly fetched.

You might try removing a field from the DatosSSCC or LINEAEXPEDICION tables so that the queries on those tables throw an exception. The exception stack trace might help pinpoint what is causing the queries to trigger within the application.

Best Regards,
Chris
Re: LAZY LOADING ONETOONE MANYTOONE [message #1211859 is a reply to message #1211586] Tue, 26 November 2013 17:01 Go to previous messageGo to next message
Carlos Curos is currently offline Carlos CurosFriend
Messages: 5
Registered: November 2013
Junior Member
Many thanks, I 'll see it.
icon9.gif  Re: LAZY LOADING ONETOONE MANYTOONE [message #1214262 is a reply to message #1211586] Wed, 27 November 2013 16:14 Go to previous message
Carlos Curos is currently offline Carlos CurosFriend
Messages: 5
Registered: November 2013
Junior Member
Hi, I've checked the FINEST log and i've nticed some things that I don't undertand.
In initalitaxion of entity manager I have a lot of records like :
[EL Finer]: metamodel: 2013-11-27 16:35:51.384--Thread(Thread[main,5,main])--Canonical Metamodel class [controlDispositivos.CarrTitan_] not found during initialization.
it is a problem? it seems it appears in all of class.

Then, we check que screen that it seems it's not doing lazy fetching, starts with query in line 22728 of log file i attach.

[EL Finest]: query: 2013-11-27 16:44:03.844--Thread(Thread[LongTaskProgressBar ComponenteMenu,6,main])--Execute query ReadAllQuery(referenceClass=Expedicion sql="SELECT EXPEDICION, TIPO, CLIENTE, CPENVIO, CREADOMANUAL, DATOEXTRA1, DATOEXTRA2, DATOEXTRA3, DATOEXTRA4, DATOEXTRA5, DIRENVIO, DIRENVIO2, DOCNUM, DOCUMENTO, EXPEDICIONAGENCIA, FECHACREACION, FECHAINISERVICIO, FECHAPREVISTASERVICIO, FECHASERVICIO, FECHATRASPASO, FICHEROIN, FICHEROOUT, IDPROCESO, IMPORTEAGENCIA, IMPRALBARAN, IMPRETIQUETA, IMPRFACTURA, IMPRPACKING, LINEAS, NOMCLI, NUMALBARANES, OBSERVACIONAGENCIA, OBSERVACIONALBARAN, OBSERVACIONALMACEN, PACKINGIMPRESO, PAISENVIO, PARKINGEXPED, POBLACIONENVIO, PORTES, PRIORIDAD, PROVINCIAENVIO, STATUS, STATUSOPE, SUREFERENCIA, TELEFONOENVIO, TIPOSERVICIOTRANSPORTE, URGENCIA, VERSION, agencia, agrupacionServicio, codcliente, envioAgencia, estadocarro, grupoEmbalaje, packingList, remitente, tanda, tipoAlmacen, tipoFlujo, tipomovimientocliente, nodooptimizacion FROM EXPEDICION WHERE ((FECHACREACION BETWEEN ? AND ?) AND (((((((STATUS = ?) OR (STATUS = ?)) OR (STATUS = ?)) OR (STATUS = ?)) OR (STATUS = ?)) OR (STATUS = ?)) OR (STATUS = ?))) ORDER BY PRIORIDAD, EXPEDICION")

After that query , launhes automatically many querys , that is correct because we are accesing to those class. but not the mentioned before. I don't unertand why.
Please any good idea to know what is happening? Embarrassed Embarrassed
Previous Topic:isLoaded NullPointerException
Next Topic:Lazy loading + threads = ConcurrencyException
Goto Forum:
  


Current Time: Thu Apr 25 19:22:16 GMT 2024

Powered by FUDForum. Page generated in 0.02778 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top