slumber86 / express-oracle-session Goto Github PK
View Code? Open in Web Editor NEWThis project forked from chill117/express-mysql-session
An Oracle session store for express
License: MIT License
This project forked from chill117/express-mysql-session
An Oracle session store for express
License: MIT License
Currently express-oracle-session
depends on "oracledb": "^1.12.2"
, which is a pretty old package, while oracledb
version 4 is out there.
And that seems to be a problem for Node 12, where oracledb
with version lower than 4 fails to build.
Are there plans to review and bump dependencies?
Thank you.
Just letting you know that you have 2 hardcoded reference to 'sessions' table name in index.js version 0.1.2.
You pass the passed 'options' to oracledb.createPool which means that we can set createPool related options. Once such option supported by oracledb is poolAlias. You go on to oracledb.getConnection and by not passing a poolAlias, you hardcode to use the 'default' pool. Your solution would be more robust if you instead oracledb.getconnection(options.poolAlias || 'default'......
cheers!
Great module. One small tweak: could you enforce outFormat: oracledb.ARRAY for all the execute calls that rely on arrays as return value? I am running the store in a context where the global outFormat of the oracledb module gets overwritten, and thus the parsing of the session string fails.
E.g., in row 144 of index.js:
this.connection.execute(sql, params, { fetchInfo: { "DATA": { type: oracledb.STRING} } },
instead, use
this.connection.execute(sql, params, { outFormat: oracledb.ARRAY, fetchInfo: { "DATA": { type: oracledb.STRING} } },
Thanks,
Florian
When execuded one to one almost all unit test are passing, when build in CI or with npm test
timeouts happens for oracle connection, if there is someone with better understatment of oracle driver, help will be appreciated
For the first time, when there is no session, it is working correctly. However, I am Getting following error during second request for the same REST API
Error: Failed to parse data for session: U8vEpeRt0jI-Ytic3nCmmvEagF7rxmEJ
at C:\project\proj1\node_modules\express-oracle-session\lib\index.js:160:15
at custExecuteCb (C:\project\proj1\node_modules\oracledb\lib\connection.js:117:5)
Code is mentioned below
`var session = require('express-session');
var oracleDbStore = require('express-oracle-session')(session);
var sessionStoreOptions = {
checkExpirationInterval: 900000,// How frequently expired sessions will be cleared; milliseconds. Here 15 minutes.
expiration: 1800000,// The maximum age of a valid session; milliseconds. Here 30 minutes.
createDatabaseTable: true,// Whether or not to create the sessions database table, if one does not already exist.
connectionLimit: 1
};
var sessionStore = new oracleDbStore(sessionStoreOptions, connection);
app.use(session({
key: 'sessionID',
secret: 'secret',
store: sessionStore,
resave: false,
saveUninitialized: true
}));`
I tried to debug and found that in the index.js (inside lib) at line number 155, 'JSON.parse(result.rows[0][0])' is done. Instead it should be 'JSON.parse(result.rows[0].data)'.
Code from index.js (present in lib) is as follows
`try {
//debug_log('Session result: ' + result.rows[0]);
var session = result.rows[0] !== undefined ? JSON.parse(result.rows[0][0]) : null;
//debug_log('Session return: ' + session);
} catch (error) {
debug_error(error);
return cb(new Error('Failed to parse data for session: ' + session_id));
}`
Unable to parse the session data error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.