Torque
  1. Torque
  2. TORQUE-153

Fail if null connection is supplied to a method

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-beta1
    • Component/s: Runtime
    • Labels:
      None

      Description

      Current behaviour: Methods with a connection argument silently fetch a new connection if the passed connection is null
      New behaviour: These methods should throw an exception if the passed connection is null
      Rationale: these methods will be only needed if a method should be executed in a transaction context. If one assumes that a transaction is open (connection is not null), but it is not (connection == null), it is a bad idea to silently start one as this behaviour is very difficult to tell from the correct one. A clean failure is much easier to test for.

        Activity

        Thomas Fox created issue -
        Thomas Fox made changes -
        Field Original Value New Value
        Assignee Thomas Fox [ tfischer ]
        Hide
        Thomas Fox added a comment -

        All methods in BasePeer and the generated Peer classe should now use the behaviour.Only known exception is the IdBroker where the behaviour has always been configurable and is left as it is.

        Show
        Thomas Fox added a comment - All methods in BasePeer and the generated Peer classe should now use the behaviour.Only known exception is the IdBroker where the behaviour has always been configurable and is left as it is.
        Thomas Fox made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 4.0 [ 12312102 ]
        Resolution Fixed [ 1 ]
        Thomas Fox made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Thomas Fox
            Reporter:
            Thomas Fox
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development