Derby
  1. Derby
  2. DERBY-2762

Document, verify and fix synchronization issues related to Clob in the embedded driver

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 10.3.1.4
    • Fix Version/s: None
    • Component/s: JDBC
    • Urgency:
      Normal

      Description

      Synchronization with respect to Clobs is a bit tricky.
      A full review of synchronization should be performed, and documentation and actual behavior must be made in agreement with each other.

      The synchronization wrt. Clob is made tricker due to the many streams that can be used to read or write its value.
      The main classes to review will be (there might be more):
      a) EmbedClob
      b) StoreStreamClob
      c) ClobStreamControl (may be renamed to TemporaryClob)
      d) ClobUtf8Writer
      e) ClobAsciiStream
      f) ClobUpdateableReader

      We should also clarify and document what is supposed to be allowed. Can
      you read from one stream and write to another one at the same time, both
      from the same Clob?
      Can you expect the ascii stream and the character stream to be in sync
      if you read from both of them?

      A related issue is that of garbage collection of underlying resources
      before the streams are closed. DERBY-2734 has already been filed for
      this.

      I would like to try a little experiment by using a few simple
      annotations to document intended synchronization policies. These are the
      annotations defined in the book "Java Concurrency in Practice" by Brian
      Goetz et al, and the JavaDoc for them can be found here:
      http://javaconcurrencyinpractice.com/annotations/doc/index.html

      Since we are still using Java 1.4, the annotations must be used as
      comments. I still think they are valuable, as we do not use any tools to
      document/check synchronization anyway.

      Briefly, the following four annotations are defined:
      @GuardedBy
      @Immutable
      @NotThreadSafe
      @ThreadSafe

        Issue Links

          Activity

          Kristian Waagan created issue -
          Kristian Waagan made changes -
          Field Original Value New Value
          Link This issue is part of DERBY-2646 [ DERBY-2646 ]
          Myrna van Lunteren made changes -
          Fix Version/s 10.3.0.0 [ 12310800 ]
          Rick Hillegas made changes -
          Issue Type Bug [ 1 ] Task [ 3 ]
          Urgency Normal
          Kristian Waagan made changes -
          Labels CLOB
          Dag H. Wanvik made changes -
          Link This issue relates to DERBY-4129 [ DERBY-4129 ]
          Gavin made changes -
          Workflow jira [ 12405548 ] Default workflow, editable Closed status [ 12801549 ]
          Mamta A. Satoor made changes -
          Labels CLOB CLOB derby_triage10_11

            People

            • Assignee:
              Unassigned
              Reporter:
              Kristian Waagan
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development