Giter Club home page Giter Club logo

Comments (2)

raymondfeng avatar raymondfeng commented on August 18, 2024

You need to explicitly pass the transaction into create.

const address = await this.addressRepo.create(addressObj, {transaction});

See https://loopback.io/doc/en/lb4/Using-database-transactions.html#perform-operations-in-a-transaction

from loopback-connector-mssql.

metkuten avatar metkuten commented on August 18, 2024

@raymondfeng : still facing issue, i have implemented transaction as mentioned above. but sometime its returning undefined after calling beginTransaction instead of Promise.

getting below error in console. Kindly help on this.

2019-11-15T21:00:52.747Z [founders-mw-dev-699fbb8489-z6k46] error: {"APPLICATION_NAME":"FOUNDERS_SVC","MESSAGE":"uncaughtException: cb is not a function\nTypeError: cb is not a function\n at /u01/foundersplatform/founders-mw/node_modules/loopback-connector/lib/transaction.js:119:5\n at /u01/foundersplatform/founders-mw/node_modules/loopback-connector-mssql/lib/transaction.js:25:7\n at /u01/foundersplatform/founders-mw/node_modules/loopback-connector-mssql/node_modules/mssql/lib/base.js:813:9\n at /u01/foundersplatform/founders-mw/node_modules/loopback-connector-mssql/node_modules/mssql/lib/tedious.js:333:11\n at Request.userCallback (/u01/foundersplatform/founders-mw/node_modules/loopback-connector-mssql/node_modules/tedious/lib/connection.js:1479:16)\n at Request._this.callback (/u01/foundersplatform/founders-mw/node_modules/loopback-connector-mssql/node_modules/tedious/lib/request.js:61:27)\n at Connection.endOfMessageMarkerReceived (/u01/foundersplatform/founders-mw/node_modules/loopback-connector-mssql/node_modules/tedious/lib/connection.js:1944:20)\n at Connection.dispatchEvent (/u01/foundersplatform/founders-mw/node_modules/loopback-connector-mssql/node_modules/tedious/lib/connection.js:1012:38)\n at Parser. (/u01/foundersplatform/founders-mw/node_modules/loopback-connector-mssql/node_modules/tedious/lib/connection.js:812:18)\n at Parser.emit (events.js:209:13)\n at Parser. (/u01/foundersplatform/founders-mw/node_modules/loopback-connector-mssql/node_modules/tedious/lib/token/token-stream-parser.js:54:15)\n at Parser.emit (events.js:209:13)\n at addChunk (/u01/foundersplatform/founders-mw/node_modules/readable-stream/lib/_stream_readable.js:291:12)\n at readableAddChunk (/u01/foundersplatform/founders-mw/node_modules/readable-stream/lib/_stream_readable.js:278:11)\n at Parser.Readable.push (/u01/foundersplatform/founders-mw/node_modules/readable-stream/lib/_stream_readable.js:245:10)\n at Parser.Transform.push (/u01/foundersplatform/founders-mw/node_modules/readable-stream/lib/_stream_transform.js:148:32)"}

from loopback-connector-mssql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.