Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Challenge Overview

We are using node-orm2 module in a nodejs application to access PostgreSQL database. Recently we started using transaction and we found that there is a bug in handling transaction in this module when using it in both single connection mode and connection pooling mode. We are fixing the module in this challenge

Challenge Scope

Note: Please read the whole Application Design Specification first. All the details not mentioned in this specification are provided in that document.

You are provided with architecture solution, and in this assembly challenge you are implementing all elements in the TCUML class diagrams. and Fixing unit tests.

Provided Code

All the needed changes have already been applied to the orm-txn-bug\node_modules\orm module.

The newly added transaction argument is added before the callback argument in all affected methods in JS files.

But some improvements are required to make it compatible to the other drivers:

  • In Model.js, when the transaction is null, don’t pass the transaction into the Driver’s method. (e.g. you should push all arguments to an array and use the apply JS function to call the Driver’s method, and when the transaction is null, don’t push it into the array).

You need to verify they are implemented correctly. You need to verify that the non-transaction mode is not broken as well.

Tests

  • You need to ensure the original tests for the orm module still work.
  • You should add new tests for the transaction fix.
  • Tests must cover all possible cases to use transaction : using hooks, associations .. etc.
  • Update tests to include the scenarios implemented in orm-txn-bug folder (you can find the folder in provide architecture documents)

Source code and Documents

  • Provided in challenge forums the architecture winning submission. Includes all information needed to fix the node module.
  • The source code of node-orm2 https://github.com/dresende/node-orm2
    • it is better to fork this module and use it to create patches for submission of this challenge


Final Submission Guidelines

Submission Deliverables

A complete list of deliverables can be viewed in the TopCoder Assembly competition Tutorial at: http://apps.topcoder.com/wiki/display/tc/Assembly+Competition+Tutorials
Below is an overview of the deliverables:

  • Git patch file of changes related to fixing source code and unit tests.
  • Readme file detailing how to deploy and run the tests. Or you can update readme.md from node-orm2 repository

Final Submission

For each member, the final submission should be uploaded via the challenge detail page on topcoder.com.

ELIGIBLE EVENTS:

2015 topcoder Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30047369