Grokbase Groups Cayenne dev May 2011
FAQ
Hello.

In the jstack-output I am looking at now, there are several threads doing
a Util.cloneViaSerialization on some basic prefetching for a SelectQuery.
Down the java.io.ObjectOutputStream road there is some locking going on.
Is Util.cloneViaSerialization really needed here? This is with 3.1M2.

Regards,
- Tore.

"qtp1661944297-498" prio=10 tid=0x00007f48d0189000 nid=0x51ec in
Object.wait() [0x00007f48c37f4000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00007f49bb212090> (a java.io.ObjectStreamClass$EntryFuture)
at java.lang.Object.wait(Object.java:485)
at java.io.ObjectStreamClass$EntryFuture.get(ObjectStreamClass.java:371)
- locked <0x00007f49bb212090> (a java.io.ObjectStreamClass$EntryFuture)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:305)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1114)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.apache.cayenne.util.Util.cloneViaSerialization(Util.java:346)
at
org.apache.cayenne.query.BaseQueryMetadata.setPrefetchTree(BaseQueryMetadata.java:332)
at
org.apache.cayenne.query.SelectQuery.setPrefetchTree(SelectQuery.java:416)
at
org.apache.cayenne.query.SelectQueryPrefetchRouterAction.startDisjointPrefetch(SelectQueryPrefetchRouterAction.java:116)
at
org.apache.cayenne.query.SelectQueryPrefetchRouterAction.startUnknownPrefetch(SelectQueryPrefetchRouterAction.java:135)
at
org.apache.cayenne.query.PrefetchTreeNode.traverse(PrefetchTreeNode.java:173)
at
org.apache.cayenne.query.PrefetchTreeNode.traverse(PrefetchTreeNode.java:179)
at
org.apache.cayenne.query.SelectQueryPrefetchRouterAction.route(SelectQueryPrefetchRouterAction.java:54)
at
org.apache.cayenne.query.SelectQuery.routePrefetches(SelectQuery.java:179)
at org.apache.cayenne.query.SelectQuery.route(SelectQuery.java:169)
at
org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:414)
at
org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:69)
at
org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:395)
at
org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:824)
at
org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:392)
at
org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
at
org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:706)
at
org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:944)
at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:696)
at
org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:336)
at
org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:104)
at
org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:91)
at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:983)
at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:972)

Search Discussions

  • Halset at May 10, 2011 at 9:09 pm
    One more thing. In this single jstack output, there are 15 threads/stacks
    doing Util.cloneViaSerialization like the stack below!

    - Tore.
    Hello.

    In the jstack-output I am looking at now, there are several threads doing
    a Util.cloneViaSerialization on some basic prefetching for a SelectQuery.
    Down the java.io.ObjectOutputStream road there is some locking going on.
    Is Util.cloneViaSerialization really needed here? This is with 3.1M2.

    Regards,
    - Tore.

    "qtp1661944297-498" prio=10 tid=0x00007f48d0189000 nid=0x51ec in
    Object.wait() [0x00007f48c37f4000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00007f49bb212090> (a
    java.io.ObjectStreamClass$EntryFuture)
    at java.lang.Object.wait(Object.java:485)
    at java.io.ObjectStreamClass$EntryFuture.get(ObjectStreamClass.java:371)
    - locked <0x00007f49bb212090> (a java.io.ObjectStreamClass$EntryFuture)
    at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:305)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1114)
    at
    java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
    at org.apache.cayenne.util.Util.cloneViaSerialization(Util.java:346)
    at
    org.apache.cayenne.query.BaseQueryMetadata.setPrefetchTree(BaseQueryMetadata.java:332)
    at
    org.apache.cayenne.query.SelectQuery.setPrefetchTree(SelectQuery.java:416)
    at
    org.apache.cayenne.query.SelectQueryPrefetchRouterAction.startDisjointPrefetch(SelectQueryPrefetchRouterAction.java:116)
    at
    org.apache.cayenne.query.SelectQueryPrefetchRouterAction.startUnknownPrefetch(SelectQueryPrefetchRouterAction.java:135)
    at
    org.apache.cayenne.query.PrefetchTreeNode.traverse(PrefetchTreeNode.java:173)
    at
    org.apache.cayenne.query.PrefetchTreeNode.traverse(PrefetchTreeNode.java:179)
    at
    org.apache.cayenne.query.SelectQueryPrefetchRouterAction.route(SelectQueryPrefetchRouterAction.java:54)
    at
    org.apache.cayenne.query.SelectQuery.routePrefetches(SelectQuery.java:179)
    at org.apache.cayenne.query.SelectQuery.route(SelectQuery.java:169)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:414)
    at
    org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:69)
    at
    org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:395)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:824)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:392)
    at
    org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
    at
    org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:706)
    at
    org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:944)
    at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:696)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:336)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:104)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:91)
    at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:983)
    at
    org.apache.cayenne.access.DataContext.performQuery(DataContext.java:972)


  • Andrus Adamchik at May 11, 2011 at 5:36 am
    I just committed a removal of a synchronization on the ByteArrayOutputStream method inside cloneViaSerialization, which was unneeded. However I think it is not the cause of your lockup. Instead it is a synchronized block inside ObjectStreamClass. So that's a JVM class that we can't control.

    I guess that makes 'cloneViaSerialization' unusable for Cayenne stack classes. Specifically we should rewrite BaseQueryMetadata.setPrefetchTree(..) to clone PrefetchTreeNode manually, which should be pretty trivial.

    Andrus
    On May 11, 2011, at 12:08 AM, halset@pvv.ntnu.no wrote:

    One more thing. In this single jstack output, there are 15 threads/stacks
    doing Util.cloneViaSerialization like the stack below!

    - Tore.
    Hello.

    In the jstack-output I am looking at now, there are several threads doing
    a Util.cloneViaSerialization on some basic prefetching for a SelectQuery.
    Down the java.io.ObjectOutputStream road there is some locking going on.
    Is Util.cloneViaSerialization really needed here? This is with 3.1M2.

    Regards,
    - Tore.

    "qtp1661944297-498" prio=10 tid=0x00007f48d0189000 nid=0x51ec in
    Object.wait() [0x00007f48c37f4000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00007f49bb212090> (a
    java.io.ObjectStreamClass$EntryFuture)
    at java.lang.Object.wait(Object.java:485)
    at java.io.ObjectStreamClass$EntryFuture.get(ObjectStreamClass.java:371)
    - locked <0x00007f49bb212090> (a java.io.ObjectStreamClass$EntryFuture)
    at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:305)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1114)
    at
    java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
    at
    java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
    at
    java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
    at org.apache.cayenne.util.Util.cloneViaSerialization(Util.java:346)
    at
    org.apache.cayenne.query.BaseQueryMetadata.setPrefetchTree(BaseQueryMetadata.java:332)
    at
    org.apache.cayenne.query.SelectQuery.setPrefetchTree(SelectQuery.java:416)
    at
    org.apache.cayenne.query.SelectQueryPrefetchRouterAction.startDisjointPrefetch(SelectQueryPrefetchRouterAction.java:116)
    at
    org.apache.cayenne.query.SelectQueryPrefetchRouterAction.startUnknownPrefetch(SelectQueryPrefetchRouterAction.java:135)
    at
    org.apache.cayenne.query.PrefetchTreeNode.traverse(PrefetchTreeNode.java:173)
    at
    org.apache.cayenne.query.PrefetchTreeNode.traverse(PrefetchTreeNode.java:179)
    at
    org.apache.cayenne.query.SelectQueryPrefetchRouterAction.route(SelectQueryPrefetchRouterAction.java:54)
    at
    org.apache.cayenne.query.SelectQuery.routePrefetches(SelectQuery.java:179)
    at org.apache.cayenne.query.SelectQuery.route(SelectQuery.java:169)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:414)
    at
    org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:69)
    at
    org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:395)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:824)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:392)
    at
    org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
    at
    org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:706)
    at
    org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:944)
    at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:696)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:336)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:104)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:91)
    at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:983)
    at
    org.apache.cayenne.access.DataContext.performQuery(DataContext.java:972)


  • Andrus Adamchik at May 15, 2011 at 10:02 am

    On May 11, 2011, at 1:35 AM, Andrus Adamchik wrote:


    I guess that makes 'cloneViaSerialization' unusable for Cayenne stack classes. Specifically we should rewrite BaseQueryMetadata.setPrefetchTree(..) to clone PrefetchTreeNode manually, which should be pretty trivial.
    BTW just committed this fix to trunk. (should've opened a Jira I guess).

    Andrus
  • Andrus Adamchik at May 15, 2011 at 11:27 am
    Actually just opened (and closed) a Jira to ensure it gets to the release notes: https://issues.apache.org/jira/browse/CAY-1567
    On May 15, 2011, at 6:01 AM, Andrus Adamchik wrote:

    On May 11, 2011, at 1:35 AM, Andrus Adamchik wrote:


    I guess that makes 'cloneViaSerialization' unusable for Cayenne stack classes. Specifically we should rewrite BaseQueryMetadata.setPrefetchTree(..) to clone PrefetchTreeNode manually, which should be pretty trivial.
    BTW just committed this fix to trunk. (should've opened a Jira I guess).

    Andrus
  • Tore Halset at May 15, 2011 at 9:39 pm
    Wow, thanks!
    On May 15, 2011, at 12:01, Andrus Adamchik wrote:

    On May 11, 2011, at 1:35 AM, Andrus Adamchik wrote:


    I guess that makes 'cloneViaSerialization' unusable for Cayenne stack classes. Specifically we should rewrite BaseQueryMetadata.setPrefetchTree(..) to clone PrefetchTreeNode manually, which should be pretty trivial.
    BTW just committed this fix to trunk. (should've opened a Jira I guess).

    Andrus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedMay 10, '11 at 9:01p
activeMay 15, '11 at 9:39p
posts6
users2
websitecayenne.apache.org

2 users in discussion

Andrus Adamchik: 3 posts Tore Halset: 3 posts

People

Translate

site design / logo © 2021 Grokbase