Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Why is this not lazy loading?
Why is this not lazy loading? [message #385485] Fri, 13 February 2009 13:29 Go to next message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
This is my JPQL

Query lQuery = lEntityManager.createQuery("select t from Standversion t where t.iVersion=:version and t.iStand=:stand");
lQuery.setParameter("version", version);
lQuery.setParameter("stand", stand);
nl.reinders.bm.Standversion lStandversion = (nl.reinders.bm.Standversion)lQuery.getSingleResult();


The JPQL issues the following SQL because of this query:
2009-02-13 13:11:25,859 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #22775991[C17245542]: [1] setBigDecimal=8 / java.math.BigDecimal / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE ((version = >>>HERE<<< ) AND (standnr = ?))
2009-02-13 13:11:27,015 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #22775991[C17245542]: [2] setBigDecimal=1270 / java.math.BigDecimal / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE ((version = ?) AND (standnr = >>>HERE<<< ))
2009-02-13 13:11:27,812 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #22775991[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE ((version = ?) AND (standnr = ?))

That is correct and returns one row (standversionnr = 3092). And then, in the same JPQL query, all the related standversions "derrivedfromstandversionnr" (3088 -> 2695 -> 2535, ...) are fetched.
Why? Eclipse is weaving, the collection lazy loading, I just fetch the one entity; I expected all after 3088 would be lazy loaded. Is it because of the CascadeType maybe?

@OneToMany(mappedBy = "iDerrivedfromstandversion", fetch = FetchType.LAZY, targetEntity = nl.reinders.bm.Standversion.class, cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE} )
volatile protected java.util.List<nl.reinders.bm.Standversion> iStandversionsWhereIAmDerrivedfromstandversion = new java.util.ArrayList<nl.reinders.bm.Standversion>();


2009-02-13 13:11:31,375 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #19361338[C17245542]: [1] setInt=3088 / java.lang.Integer / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = >>>HERE<<< )
2009-02-13 13:11:32,656 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #19361338[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = ?)
2009-02-13 13:11:35,687 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #19733892[C17245542]: [1] setInt=2695 / java.lang.Integer / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = >>>HERE<<< )
2009-02-13 13:11:38,359 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #19733892[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = ?)
2009-02-13 13:11:43,562 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #17993445[C17245542]: [1] setInt=1107 / java.lang.Integer / SELECT standnr, derrivedfromstandnr, standid, oldid, size, lazylock, seqnr, inifillsize, description, dwhmodified, dwhby, derrivedreason, lastcall_onlist, lastcall_text FROM stand WHERE (standnr = >>>HERE<<< )
2009-02-13 13:11:49,562 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #17993445[C17245542]: executeQuery: SELECT standnr, derrivedfromstandnr, standid, oldid, size, lazylock, seqnr, inifillsize, description, dwhmodified, dwhby, derrivedreason, lastcall_onlist, lastcall_text FROM stand WHERE (standnr = ?)
2009-02-13 13:11:55,484 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #6992386[C17245542]: [1] setInt=2535 / java.lang.Integer / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = >>>HERE<<< )
2009-02-13 13:11:59,187 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #6992386[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = ?)
2009-02-13 13:12:04,875 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #20127633[C17245542]: [1] setInt=2311 / java.lang.Integer / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = >>>HERE<<< )
2009-02-13 13:12:09,062 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #20127633[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = ?)
2009-02-13 13:12:16,546 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #30842701[C17245542]: [1] setInt=2213 / java.lang.Integer / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = >>>HERE<<< )
2009-02-13 13:12:21,703 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #30842701[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = ?)
2009-02-13 13:12:29,687 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #20450864[C17245542]: [1] setInt=2051 / java.lang.Integer / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = >>>HERE<<< )
2009-02-13 13:12:37,265 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #20450864[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = ?)
2009-02-13 13:12:48,218 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #504023[C17245542]: [1] setInt=2050 / java.lang.Integer / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = >>>HERE<<< )
2009-02-13 13:12:57,562 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #504023[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = ?)
2009-02-13 13:13:10,156 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #33510924[C17245542]: [1] setInt=2049 / java.lang.Integer / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = >>>HERE<<< )
2009-02-13 13:13:20,703 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #33510924[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = ?)
2009-02-13 13:13:35,718 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #27079982[C17245542]: [1] setInt=2032 / java.lang.Integer / SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = >>>HERE<<< )
2009-02-13 13:13:47,250 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #27079982[C17245542]: executeQuery: SELECT standversionnr, standnr, derrivedfromstandversionnr, version, replace_date, price_per_unit, lazylock, dwhmodified, dwhby, inifill, comment, enforce_unique_ean FROM standversion WHERE (standversionnr = ?)
2009-02-13 13:14:02,500 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #29556931[C17245542]: [1] setInt=1085 / java.lang.Integer / SELECT standnr, derrivedfromstandnr, standid, oldid, size, lazylock, seqnr, inifillsize, description, dwhmodified, dwhby, derrivedreason, lastcall_onlist, lastcall_text FROM stand WHERE (standnr = >>>HERE<<< )
2009-02-13 13:14:18,031 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #29556931[C17245542]: executeQuery: SELECT standnr, derrivedfromstandnr, standid, oldid, size, lazylock, seqnr, inifillsize, description, dwhmodified, dwhby, derrivedreason, lastcall_onlist, lastcall_text FROM stand WHERE (standnr = ?)
2009-02-13 13:14:37,609 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #21786922[C17245542]: [1] setInt=22 / java.lang.Integer / SELECT standnr, derrivedfromstandnr, standid, oldid, size, lazylock, seqnr, inifillsize, description, dwhmodified, dwhby, derrivedreason, lastcall_onlist, lastcall_text FROM stand WHERE (standnr = >>>HERE<<< )
2009-02-13 13:14:55,015 DEBUG org.tbee.util.jdbc.PreparedStatement.invoke(PreparedStatemen t.java:139) #21786922[C17245542]: executeQuery: SELECT standnr, derrivedfromstandnr, standid, oldid, size, lazylock, seqnr, inifillsize, description, dwhmodified, dwhby, derrivedreason, lastcall_onlist, lastcall_text FROM stand WHERE (standnr = ?)


This is the standversion table underneath the Standversion entity:

create table standversion
(
standversionnr integer not null ,
standnr integer not null ,
version integer not null ,
replace_date date not null ,
price_per_unit money(16,2) not null ,
lazylock integer default 0,
dwhmodified datetime year to second default current year to second,
dwhby integer,
inifill integer default 1 not null ,
comment varchar(255),
derrivedfromstandversionnr integer,
enforce_unique_ean integer default 1 not null ,
unique (replace_date,standnr) constraint ak_standv_standdat,
unique (version,standnr) constraint ak_standv_standver,
primary key (standversionnr) constraint pk_standversion
);
alter table standversion add constraint (foreign key (derrivedfromstandversionnr) references standversion constraint standversion_fk01);
....
Re: Why is this not lazy loading? [message #385486 is a reply to message #385485] Fri, 13 February 2009 15:25 Go to previous messageGo to next message
Doug Clarke is currently offline Doug Clarke
Messages: 155
Registered: July 2009
Senior Member
The cascading will not cause this. I would guess that the lazy loading is
not working as you expect or something in your application is triggering
the relationships to load. I just debugged a test case of my own where
deep inside my test harness I was triggering a toString that was causing
additional loading.

Can you post the mappings (annotations/XML)?

I see you have debug tracing in your app. Can you capture the stack in the
debug operations where the unnecessary SQL is being executed to verify
what is causing the query?

Doug
Re: Why is this not lazy loading? [message #385487 is a reply to message #385486] Fri, 13 February 2009 15:41 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
> I see you have debug tracing in your app. Can you capture the stack in
> the debug operations where the unnecessary SQL is being executed to
> verify what is causing the query?

Sure. This is when the prepared statement parameter (3088) for loading the first related object is set.

Thread [AWT-EventQueue-1] (Suspended (breakpoint at line 88 in PreparedStatement))
PreparedStatement.invoke(Object, Method, Object[]) line: 88
$Proxy34.setInt(int, int) line: not available
InformixPlatform(DatabasePlatform).setParameterValueInDataba seCall(Object, PreparedStatement, int, AbstractSession) line: 1738
SQLCall(DatabaseCall).prepareStatement(DatabaseAccessor, AbstractRecord, AbstractSession) line: 667
DatabaseAccessor.basicExecuteCall(Call, AbstractRecord, AbstractSession) line: 550
DatabaseAccessor.executeCall(Call, AbstractRecord, AbstractSession) line: 500
ServerSession.executeCall(Call, AbstractRecord, DatabaseQuery) line: 522
IsolatedClientSession.executeCall(Call, AbstractRecord, DatabaseQuery) line: 134
ExpressionQueryMechanism(DatasourceCallQueryMechanism).execu teCall(DatasourceCall) line: 204
ExpressionQueryMechanism(DatasourceCallQueryMechanism).execu teCall() line: 190
ExpressionQueryMechanism(DatasourceCallQueryMechanism).selec tOneRow() line: 614
ExpressionQueryMechanism.selectOneRowFromTable() line: 2549
ExpressionQueryMechanism.selectOneRow() line: 2519
ReadObjectQuery.executeObjectLevelReadQuery() line: 425
ReadObjectQuery(ObjectLevelReadQuery).executeDatabaseQuery() line: 879
ReadObjectQuery(DatabaseQuery).execute(AbstractSession, AbstractRecord) line: 666
ReadObjectQuery(ObjectLevelReadQuery).execute(AbstractSessio n, AbstractRecord) line: 840
ReadObjectQuery.execute(AbstractSession, AbstractRecord) line: 398
ReadObjectQuery(ObjectLevelReadQuery).executeInUnitOfWork(Un itOfWorkImpl, AbstractRecord) line: 902
RepeatableWriteUnitOfWork(UnitOfWorkImpl).internalExecuteQue ry(DatabaseQuery, AbstractRecord) line: 2587
RepeatableWriteUnitOfWork(AbstractSession).executeQuery(Data baseQuery, AbstractRecord, int) line: 1178
RepeatableWriteUnitOfWork(AbstractSession).executeQuery(Data baseQuery, AbstractRecord) line: 1162
QueryBasedValueHolder.instantiate(AbstractSession) line: 77
QueryBasedValueHolder.instantiate() line: 67
QueryBasedValueHolder(DatabaseValueHolder).getValue() line: 83
UnitOfWorkQueryValueHolder(UnitOfWorkValueHolder).instantiat eImpl() line: 161
UnitOfWorkQueryValueHolder(UnitOfWorkValueHolder).instantiat e() line: 230
UnitOfWorkQueryValueHolder(DatabaseValueHolder).getValue() line: 83
Standversion(Standversion)._persistence_getiDerrivedfromstan dversion() line: not available
Standversion(Standversion).getDerrivedfromstandversion() line: 269
Standversion(Standversion).rememberAtLoadTimeValues() line: 614
Standversion(AbstractBean).postLoad() line: 229
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
PrivilegedAccessHelper.invokeMethod(Method, Object, Object[]) line: 344
EntityClassListener(EntityListener).invokeMethod(Method, Object, Object[], DescriptorEvent) line: 297
EntityClassListener.invokeMethod(String, DescriptorEvent) line: 64
EntityClassListener(EntityListener).postBuild(DescriptorEven t) line: 370
DescriptorEventManager.notifyListener(DescriptorEventListene r, DescriptorEvent) line: 635
DescriptorEventManager.notifyEJB30Listeners(DescriptorEvent) line: 593
DescriptorEventManager.executeEvent(DescriptorEvent) line: 187
ObjectBuilder.buildAttributesIntoWorkingCopyClone(Object, ObjectBuildingQuery, JoinedAttributeManager, AbstractRecord, UnitOfWorkImpl, boolean) line: 1260
ObjectBuilder.buildWorkingCopyCloneFromRow(ObjectBuildingQue ry, JoinedAttributeManager, AbstractRecord, UnitOfWorkImpl, Vector) line: 1355
ObjectBuilder.buildObjectInUnitOfWork(ObjectBuildingQuery, JoinedAttributeManager, AbstractRecord, UnitOfWorkImpl, Vector, ClassDescriptor) line: 513
ObjectBuilder.buildObject(ObjectBuildingQuery, AbstractRecord, JoinedAttributeManager) line: 461
ObjectBuilder.buildObject(ObjectLevelReadQuery, AbstractRecord) line: 413
ReadAllQuery(ObjectLevelReadQuery).buildObject(AbstractRecor d) line: 521
ReadAllQuery.registerResultInUnitOfWork(Object, UnitOfWorkImpl, AbstractRecord, boolean) line: 893
ReadAllQuery.executeObjectLevelReadQuery() line: 486
ReadAllQuery(ObjectLevelReadQuery).executeDatabaseQuery() line: 879
ReadAllQuery(DatabaseQuery).execute(AbstractSession, AbstractRecord) line: 666
ReadAllQuery(ObjectLevelReadQuery).execute(AbstractSession, AbstractRecord) line: 840
ReadAllQuery.execute(AbstractSession, AbstractRecord) line: 456
ReadAllQuery(ObjectLevelReadQuery).executeInUnitOfWork(UnitO fWorkImpl, AbstractRecord) line: 902
RepeatableWriteUnitOfWork(UnitOfWorkImpl).internalExecuteQue ry(DatabaseQuery, AbstractRecord) line: 2587
RepeatableWriteUnitOfWork(AbstractSession).executeQuery(Data baseQuery, AbstractRecord, int) line: 1178
RepeatableWriteUnitOfWork(AbstractSession).executeQuery(Data baseQuery, AbstractRecord) line: 1162
RepeatableWriteUnitOfWork(AbstractSession).executeQuery(Data baseQuery, Vector) line: 1136
RepeatableWriteUnitOfWork(AbstractSession).executeQuery(Data baseQuery, List) line: 1118
EJBQueryImpl.executeReadQuery() line: 399
EJBQueryImpl.getSingleResult() line: 547
Standversion.findByStandVersion(Stand, Number) line: 239
Relation.determineLastSoldStandversionFor(Stand) line: 201
RND_OID_Handler_toN_sellorderlineGUI$AddWholeStand$StandVers ionModel.reload() line: 831
RND_OID_Handler_toN_sellorderlineGUI$AddWholeStand.<init>(RND_OID_Handler_toN_sellorderlineGUI, JFrame) line: 728
RND_OID_Handler_toN_sellorderlineGUI.addWholeStand() line: 659
RND_OID_Handler_toN_sellorderlineGUI$8.actionPerformed(Actio nEvent) line: 348
JButton(AbstractButton).fireActionPerformed(ActionEvent) line: 1995
AbstractButton$Handler.actionPerformed(ActionEvent) line: 2318
DefaultButtonModel.fireActionPerformed(ActionEvent) line: 387
DefaultButtonModel.setPressed(boolean) line: 242
BaseButtonListener(BasicButtonListener).mouseReleased(MouseE vent) line: 236
BaseButtonListener.mouseReleased(MouseEvent) line: not available
AWTEventMulticaster.mouseReleased(MouseEvent) line: 272
JButton(Component).processMouseEvent(MouseEvent) line: 6216
JButton(JComponent).processMouseEvent(MouseEvent) line: 3265
JButton(Component).processEvent(AWTEvent) line: 5981
JButton(Container).processEvent(AWTEvent) line: 2036
JButton(Component).dispatchEventImpl(AWTEvent) line: 4583
JButton(Container).dispatchEventImpl(AWTEvent) line: 2094
JButton(Component).dispatchEvent(AWTEvent) line: 4413
LightweightDispatcher.retargetMouseEvent(Component, int, MouseEvent) line: 4551
LightweightDispatcher.processMouseEvent(MouseEvent) line: 4215
LightweightDispatcher.dispatchEvent(AWTEvent) line: 4145
JFrame(Container).dispatchEventImpl(AWTEvent) line: 2080
JFrame(Window).dispatchEventImpl(AWTEvent) line: 2475
JFrame(Component).dispatchEvent(AWTEvent) line: 4413
EventQueue(EventQueue).dispatchEvent(AWTEvent) line: 599
EventQueue.dispatchEvent(AWTEvent) line: 83
EventDispatchThread.pumpOneEventForFilters(int) line: 269
EventDispatchThread.pumpEventsForFilter(int, Conditional, EventFilter) line: 184
EventDispatchThread.pumpEventsForHierarchy(int, Conditional, Component) line: 174
EventDispatchThread.pumpEvents(int, Conditional) line: 169
EventDispatchThread.pumpEvents(Conditional) line: 161
EventDispatchThread.run() line: 122
Re: Why is this not lazy loading? [message #385488 is a reply to message #385487] Fri, 13 February 2009 15:42 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
> Sure. This is when the prepared statement parameter (3088) for loading
> the first related object is set.

Right!!!!

Standversion(Standversion)._persistence_getiDerrivedfromstan dversion() line: not available
Standversion(Standversion).getDerrivedfromstandversion() line: 269
Standversion(Standversion).rememberAtLoadTimeValues() line: 614
Re: Why is this not lazy loading? [message #385489 is a reply to message #385488] Fri, 13 February 2009 16:05 Go to previous messageGo to next message
Doug Clarke is currently offline Doug Clarke
Messages: 155
Registered: July 2009
Senior Member
Can I assume from this you found the code in your postLoad event that is
causing the relationship to load:

Standversion(AbstractBean).postLoad() line: 229
Re: Why is this not lazy loading? [message #385490 is a reply to message #385489] Fri, 13 February 2009 16:56 Go to previous message
Tom Eugelink is currently offline Tom Eugelink
Messages: 807
Registered: July 2009
Senior Member
Doug Clarke wrote:
> Can I assume from this you found the code in your postLoad event that is
> causing the relationship to load:
>
> Standversion(AbstractBean).postLoad() line: 229

Yes, my bad.

I often require the values of the properties as they were at load time (so unchanged by any current user action) in order to determine if certain actions are allowed (e.g. a bill set to "billed" is severely restricted, but you only want to enforce those after the user has saved the change).

So I wrote a routine in the reverse engineer database logic that remembers all values at load time; even the lazy loading ones. Duh.

Tom
Previous Topic:EntityManager life cycle in OSGi application
Next Topic:Alter Table & create Index
Goto Forum:
  


Current Time: Thu Oct 02 06:25:05 GMT 2014

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

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