[Dolphin] Re: Problems with BlindCommandBatcher

helmutATwork . helmutATwork ." <helmut.at.work@gmail.com
Sun, 5 Apr 2015 15:22:34 +0200


--089e011619c412ca4b0512fa1392
Content-Type: text/plain; charset=UTF-8

Happy Easter!

Thanks to Dierk I resolved my problem (Exception).

I have misunderstood the behaviour of the BlindCommandBatcher. It only
works for ValueChangedCommands.
Instead of sending Commands for every value Dierk suggested to use
"...clientDolphin.getClientModelStore().withPresentationModel(...)"

Because I couldn't find a an java example that fits my needs (maven java8)
I pushed my code to github. Perhaps someone find it useful.
@Dierk I was unsure if my sample match the project structure in the canoo
repro, so I pushed it to my own repro.
https://github.com/helmut-at-work/OpenDolphin_Maven_Java_Demo

Here are the part that causes the Exception (including the fix):
https://github.com/helmut-at-work/OpenDolphin_Maven_Java_Demo/blob/master/clientlazy/src/main/java/org/opendolphin/mvndemo/clientlazy/DemoController.java#L158-175

Greetings Helmut






2015-04-01 9:18 GMT+02:00 helmut.at.work <helmut.at.work@gmail.com>:

> Hello,
>
> I played around with the lazy loading feature.
> I'm using JDK8  Java and Maven (sorry no Groovy knowledge)
> I was able to refactor the "LazyLoadingView" to Java. All worked as
> expected. (OpenDolphin rocks :)
>
> Now I add some more Columns and changed the defferMillis value of the
> Batcher to see the performance impact.
>                                BlindCommandBatcher batcher = new
> BlindCommandBatcher();
>                                batcher.setDeferMillis(1000);
>                                batcher.setMergeValueChanges(true);
>
> Exception "There already is a presentation model with id '6142' known to
> the client." if I scroll down the table.
> It only occurs with a value > 50.
> Any Ideas?
>
> Greetings Helmut
>
>
> Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException:
> There already is a presentation model with id '6142' known to the client.
>                 at org.opendolphin.core.client.
> comm.ClientConnector.handle(ClientConnector.groovy:190)
>                 at org.opendolphin.core.client.
> comm.ClientConnector$handle$1.callCurrent(Unknown Source)
>                 at org.opendolphin.core.client.comm.ClientConnector.
> dispatchHandle(ClientConnector.groovy:139)
>                 at org.opendolphin.core.client.comm.ClientConnector.
> processResults(ClientConnector.groovy:120)
>                 at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown
> Source)
>                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>                 at java.lang.reflect.Method.invoke(Method.java:483)
>                 at org.codehaus.groovy.reflection.CachedMethod.
> invoke(CachedMethod.java:90)
>                 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.
> java:233)
>                 at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.
> invokeMethod(ClosureMetaClass.java:368)
>                 at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.
> java:909)
>                 at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.
> callCurrent(PogoMetaClassSite.java:66)
>                 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.
> callCurrent(AbstractCallSite.java:145)
>                 at org.opendolphin.core.client.comm.ClientConnector$_
> startCommandProcessing_closure3_closure12.doCall(
> ClientConnector.groovy:85)
>                 at org.opendolphin.core.client.comm.ClientConnector$_
> startCommandProcessing_closure3_closure12.doCall(ClientConnector.groovy)
>                 at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown
> Source)
>                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>                 at java.lang.reflect.Method.invoke(Method.java:483)
>                 at org.codehaus.groovy.reflection.CachedMethod.
> invoke(CachedMethod.java:90)
>                 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.
> java:233)
>                 at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.
> invokeMethod(ClosureMetaClass.java:278)
>                 at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.
> java:909)
>                 at groovy.lang.Closure.call(Closure.java:423)
>                 at groovy.lang.Closure.call(Closure.java:417)
>                 at groovy.lang.Closure.run(Closure.java:504)
>                 at com.sun.javafx.application.
> PlatformImpl.lambda$null$164(PlatformImpl.java:292)
>                 at com.sun.javafx.application.PlatformImpl$$Lambda$48/1597563532.run(Unknown
> Source)
>                 at java.security.AccessController.doPrivileged(Native
> Method)
>                 at com.sun.javafx.application.
> PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
>                 at com.sun.javafx.application.PlatformImpl$$Lambda$47/
> 2052454759.run(Unknown Source)
>                 at com.sun.glass.ui.InvokeLaterDispatcher$Future.
> run(InvokeLaterDispatcher.java:95)
>                 at com.sun.glass.ui.win.WinApplication._runLoop(Native
> Method)
>                 at com.sun.glass.ui.win.WinApplication.lambda$null$
> 141(WinApplication.java:102)
>                 at com.sun.glass.ui.win.WinApplication$$Lambda$38/471952006.run(Unknown
> Source)
>                 at java.lang.Thread.run(Thread.java:745)
>
>
>
>
>

--089e011619c412ca4b0512fa1392
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div><div>Happy Easter!<br><br></div>Thanks=
 to Dierk I resolved my problem (Exception).<br><br></div>I have misunderst=
ood the behaviour of the BlindCommandBatcher. It only works for ValueChange=
dCommands.<br></div>Instead of sending Commands for every value Dierk sugge=
sted to use=C2=A0 &quot;...clientDolphin.getClientModelStore().withPresenta=
tionModel(...)&quot;<br><br></div>Because I couldn&#39;t find a an java exa=
mple that fits my needs (maven java8) I pushed my code to github. Perhaps s=
omeone find it useful.<br></div>@Dierk I was unsure if my sample match the =
project structure in the canoo repro, so I pushed it to my own repro.<br><d=
iv><a href=3D"https://github.com/helmut-at-work/OpenDolphin_Maven_Java_Demo=
">https://github.com/helmut-at-work/OpenDolphin_Maven_Java_Demo</a><br><br>=
<div><div><div><div>Here are the part that causes the Exception (including =
the fix):<br><a href=3D"https://github.com/helmut-at-work/OpenDolphin_Maven=
_Java_Demo/blob/master/clientlazy/src/main/java/org/opendolphin/mvndemo/cli=
entlazy/DemoController.java#L158-175">https://github.com/helmut-at-work/Ope=
nDolphin_Maven_Java_Demo/blob/master/clientlazy/src/main/java/org/opendolph=
in/mvndemo/clientlazy/DemoController.java#L158-175</a><br><div><div><br></d=
iv><div>Greetings Helmut<br></div><div><br><br><br><br><br><div><div><div><=
div class=3D"gmail_extra"><br><div class=3D"gmail_quote">2015-04-01 9:18 GM=
T+02:00 helmut.at.work <span dir=3D"ltr">&lt;<a href=3D"mailto:helmut.at.wo=
rk@gmail.com" target=3D"_blank">helmut.at.work@gmail.com</a>&gt;</span>:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I played around with the lazy loading feature.<br>
I&#39;m using JDK8=C2=A0 Java and Maven (sorry no Groovy knowledge)<br>
I was able to refactor the &quot;LazyLoadingView&quot; to Java. All worked =
as expected. (OpenDolphin rocks :)<br>
<br>
Now I add some more Columns and changed the defferMillis value of the Batch=
er to see the performance impact.<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0BlindCommandBatcher batcher =3D new B=
lindCommandBatcher();<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0batcher.setDeferMillis(1000);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0batcher.setMergeValueChanges(<u></u>t=
rue);<br>
<br>
Exception &quot;There already is a presentation model with id &#39;6142&#39=
; known to the client.&quot; if I scroll down the table.<br>
It only occurs with a value &gt; 50.<br>
Any Ideas?<br>
<br>
Greetings Helmut<br>
<br>
<br>
Exception in thread &quot;JavaFX Application Thread&quot; java.lang.<u></u>=
IllegalStateException: There already is a presentation model with id &#39;6=
142&#39; known to the client.<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.opendolphin.=
core.client.<u></u>comm.ClientConnector.handle(<u></u>ClientConnector.groov=
y:190)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.opendolphin.=
core.client.<u></u>comm.ClientConnector$handle$1.<u></u>callCurrent(Unknown=
 Source)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.opendolphin.=
core.client.<u></u>comm.ClientConnector.<u></u>dispatchHandle(<u></u>Client=
Connector.groovy:139)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.opendolphin.=
core.client.<u></u>comm.ClientConnector.<u></u>processResults(<u></u>Client=
Connector.groovy:120)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at sun.reflect.<u><=
/u>GeneratedMethodAccessor24.<u></u>invoke(Unknown Source)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at sun.reflect.<u><=
/u>DelegatingMethodAccessorImpl.<u></u>invoke(<u></u>DelegatingMethodAccess=
orImpl.<u></u>java:43)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at java.lang.reflec=
t.Method.<u></u>invoke(Method.java:483)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.codehaus.gro=
ovy.<u></u>reflection.CachedMethod.<u></u>invoke(CachedMethod.java:90)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at groovy.lang.Meta=
Method.<u></u>doMethodInvoke(MetaMethod.<u></u>java:233)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.codehaus.gro=
ovy.runtime.<u></u>metaclass.ClosureMetaClass.<u></u>invokeMethod(ClosureMe=
taClass.<u></u>java:368)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at groovy.lang.Meta=
ClassImpl.<u></u>invokeMethod(MetaClassImpl.<u></u>java:909)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.codehaus.gro=
ovy.runtime.<u></u>callsite.PogoMetaClassSite.<u></u>callCurrent(PogoMetaCl=
assSite.<u></u>java:66)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.codehaus.gro=
ovy.runtime.<u></u>callsite.AbstractCallSite.<u></u>callCurrent(AbstractCal=
lSite.<u></u>java:145)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.opendolphin.=
core.client.<u></u>comm.ClientConnector$_<u></u>startCommandProcessing_<u><=
/u>closure3_closure12.doCall(<u></u>ClientConnector.groovy:85)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.opendolphin.=
core.client.<u></u>comm.ClientConnector$_<u></u>startCommandProcessing_<u><=
/u>closure3_closure12.doCall(<u></u>ClientConnector.groovy)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at sun.reflect.<u><=
/u>GeneratedMethodAccessor23.<u></u>invoke(Unknown Source)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at sun.reflect.<u><=
/u>DelegatingMethodAccessorImpl.<u></u>invoke(<u></u>DelegatingMethodAccess=
orImpl.<u></u>java:43)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at java.lang.reflec=
t.Method.<u></u>invoke(Method.java:483)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.codehaus.gro=
ovy.<u></u>reflection.CachedMethod.<u></u>invoke(CachedMethod.java:90)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at groovy.lang.Meta=
Method.<u></u>doMethodInvoke(MetaMethod.<u></u>java:233)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at org.codehaus.gro=
ovy.runtime.<u></u>metaclass.ClosureMetaClass.<u></u>invokeMethod(ClosureMe=
taClass.<u></u>java:278)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at groovy.lang.Meta=
ClassImpl.<u></u>invokeMethod(MetaClassImpl.<u></u>java:909)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at groovy.lang.Clos=
ure.call(<u></u>Closure.java:423)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at groovy.lang.Clos=
ure.call(<u></u>Closure.java:417)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at groovy.lang.Clos=
ure.run(<u></u>Closure.java:504)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.sun.javafx.a=
pplication.<u></u>PlatformImpl.lambda$null$164(<u></u>PlatformImpl.java:292=
)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.sun.javafx.a=
pplication.<u></u>PlatformImpl$$Lambda$48/<u></u>1597563532.run(Unknown Sou=
rce)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at java.security.<u=
></u>AccessController.doPrivileged(<u></u>Native Method)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.sun.javafx.a=
pplication.<u></u>PlatformImpl.lambda$runLater$<u></u>165(PlatformImpl.java=
:291)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.sun.javafx.a=
pplication.<u></u>PlatformImpl$$Lambda$47/<a href=3D"tel:2052454759" value=
=3D"+12052454759" target=3D"_blank">2052454759</a>.run(<u></u>Unknown Sourc=
e)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.sun.glass.ui=
.<u></u>InvokeLaterDispatcher$Future.<u></u>run(InvokeLaterDispatcher.<u></=
u>java:95)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.sun.glass.ui=
.win.<u></u>WinApplication._runLoop(Native Method)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.sun.glass.ui=
.win.<u></u>WinApplication.lambda$null$<u></u>141(WinApplication.java:102)<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.sun.glass.ui=
.win.<u></u>WinApplication$$Lambda$38/<u></u>471952006.run(Unknown Source)<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at java.lang.Thread=
.run(Thread.<u></u>java:745)<br>
<br>
<br>
<br>
<br>
</blockquote></div><br></div></div></div></div></div></div></div></div></di=
v></div></div></div>

--089e011619c412ca4b0512fa1392--