Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw transaction do not work in 2.0.11 version #4485

Closed
habi4ek opened this issue Jun 30, 2015 · 11 comments
Closed

Raw transaction do not work in 2.0.11 version #4485

habi4ek opened this issue Jun 30, 2015 · 11 comments
Assignees
Labels
Milestone

Comments

@habi4ek
Copy link

habi4ek commented Jun 30, 2015

Hi I'm using node.js and oriento.

After database upgrade to 2.0.11
I have not worked raw transaction
oriento's tests have not worked too

should execute a complex transaction, using a raw query,
should execute a complex transaction, using the query builder
should execute a complex transaction, using the query builder for let statements

Is this bug or orientDB does not support raw transaction anymore?

p.s. orientjs tests have not worked too

@lvca
Copy link
Member

lvca commented Jul 8, 2015

Could you provide more information about any error, logs or way to reproduce the problem?

@lvca lvca self-assigned this Jul 8, 2015
@habi4ek
Copy link
Author

habi4ek commented Jul 8, 2015

sorry I have no time now, I will write tomorrow necessarily

@habi4ek
Copy link
Author

habi4ek commented Jul 9, 2015

I use oriento 2.0.12

my code

var Oriento =  require('oriento')
var server = Oriento({
    host: 'localhost',
    port: 2424,
    username: 'root',
    password: 'password',
    transport: 'binary'
});

var db = server.use({
    name:       'test',
    username:   'admin',
    password:   'admin'
});

 var query = 'begin\n' +
        'let test = select from OUser\n' +
        'let count = select COUNT(*) from OUser\n' +
        'let meta = select * from ( select expand(classes) from metadata:schema ) WHERE name = \'OUser\'\n' +
        'let rez = select $test, $count, $meta \n' +
        'commit retry 100\n' +
        'return $rez'; 

    db.query(query,{class: 's'}).then(function (response){        
        console.log(JSON.stringify(response));
    },function(err){     
        console.log(err);
    });

---------------------- // -------------------------------------
my result

[{"@type":"d","$test":["#5:0","#5:1","#5:2"],"$count":[{"@type":"d","COUNT":3}],"$meta":[{"@type":"d","name":"OUser","shortName":null,"defaultClusterId":5,"clusterIds":[5],"clusterSelection":"round-robin","overSize":0,"strictMode":false,"abstract":false,"properties":[{"@type":"d","name":"name","type":7,"globalId":0,"mandatory":true,"readonly":false,"notNull":true,"min":null,"max":null,"regexp":null,"customFields":null,"collate":"ci"},{"@type":"d","name":"roles","type":15,"globalId":5,"mandatory":false,"readonly":false,"notNull":false,"min":null,"max":null,"regexp":null,"linkedClass":"ORole","customFields":null,"collate":"default"},{"@type":"d","name":"password","type":7,"globalId":4,"mandatory":true,"readonly":false,"notNull":true,"min":null,"max":null,"regexp":null,"customFields":null,"collate":"default"},{"@type":"d","name":"status","type":7,"globalId":6,"mandatory":true,"readonly":false,"notNull":true,"min":null,"max":null,"regexp":null,"customFields":null,"collate":"default"}],"superClass":"OIdentity","customFields":null}],"@rid":"#-2:1"}]

variable "$test" contains only rids without data ["#5:0","#5:1","#5:2"],

but if variable be only one

 var query = 'begin\n' +
        'let test = select from OUser\n' +       
        'commit retry 100\n' +
        'return $test ';

it work correct
---------------------- // -------------------------------------

[{"@type":"d","@class":"OUser","name":"admin","password":"{SHA-256}8C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918","status":"ACTIVE","roles":["#4:0"],"@rid":"#5:0"},{"@type":"d","@class":"OUser","name":"reader","password":"{SHA-256}3D0941964AA3EBDCB00CCEF58B1BB399F9F898465E9886D5AEC7F31090A0FB30","status":"ACTIVE","roles":["#4:1"],"@rid":"#5:1"},{"@type":"d","@class":"OUser","name":"writer","password":"{SHA-256}B93006774CBDD4B299389A03AC3D88C3A76B460D538795BC12718011A909FBA5","status":"ACTIVE","roles":["#4:2"],"@rid":"#5:2"}]

@lvca lvca added this to the 2.1 GA milestone Jul 9, 2015
@lvca lvca assigned wolf4ood and unassigned lvca Jul 9, 2015
@lvca lvca modified the milestones: 2.1 GA, 2.1.1 Aug 5, 2015
@lvca lvca modified the milestones: 2.1.1, 2.1.x (next hotfix) Aug 31, 2015
@lvca lvca added the bug label Sep 21, 2015
@wolf4ood
Copy link
Member

hi @Ivanov-Yuriy

do you still need help on this?

@habi4ek
Copy link
Author

habi4ek commented Oct 28, 2016

Hi @maggiolo00
I'm sorry to keep you waiting
I would like to this bug was fixed

@wolf4ood
Copy link
Member

@Ivanov-Yuriy

do you still have this issue with orientjs 2.2.x and OrientDB 2.2.x?

@habi4ek
Copy link
Author

habi4ek commented Oct 28, 2016

@maggiolo00

Yes, I use orientjs 2.2.2 and OrientDB 2.2.11 now.
The behavior is the same as I described above

@wolf4ood
Copy link
Member

@Ivanov-Yuriy

you can use array notation

    var query = 'begin\n' +
      'let test = select from OUser\n' +
      'let count = select COUNT(*) from OUser\n' +
      'let meta = select * from ( select expand(classes) from metadata:schema ) WHERE name = \'OUser\'\n' +
      'let rez = [$test, $count, $meta] \n' +
      'commit retry 100\n' +
      'return $rez';

or Object notation

 var query = 'begin\n' +
      'let test = select from OUser\n' +
      'let count = select COUNT(*) from OUser\n' +
      'let meta = select * from ( select expand(classes) from metadata:schema ) WHERE name = \'OUser\'\n' +
      'let rez = { test:  $test, count :  $count, meta: $meta  }\n' +
      'commit retry 100\n' +
      'return $rez';

@wolf4ood
Copy link
Member

@Ivanov-Yuriy

i've added extra test for this

orientechnologies/orientjs@6546191

@habi4ek
Copy link
Author

habi4ek commented Oct 28, 2016

it'll be fine
I'm waiting changes
thank you

@wolf4ood
Copy link
Member

@Ivanov-Yuriy

i've released the new 2.2.3 version of OrientJS.
It should over the example above

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants