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

Multiple returns for transactions - Upgraded orientjs from 2.0.0 to 2.2.2 and orientdb from 2.1.11 to 2.2.8 #199

Closed
EricLin2004 opened this issue Aug 30, 2016 · 9 comments
Assignees
Labels

Comments

@EricLin2004
Copy link

EricLin2004 commented Aug 30, 2016

I just recently upgraded my orientdb from 2.1.11 to 2.2.8 and orientjs from 2.0.0 to 2.2.2

Previously, when I had a transaction with multiple returns:

db
.let('$first', () => { ... }) 
.let('$second', () => { ... })
.return(`[$first, $second]`)
.commit()
.all()
.then((results) => {
  results[0] // Has access to all fields
  results[1] // Has access to all fields
})

Now, results[0] is JUST the @rid, something like this:

[ [ { [String: '#34:2'] cluster: 34, position: 2 } ], [] ]

It's also additionally a nested array when it wasn't before?

Any way to retain the previous behaviour? Can I add in a fetchPlan for the transaction?

Thanks in advance.

@StarpTech
Copy link

Hi @EricLin2004 I have the same issue. Please try the latest 2.2.x snapshot Release and orientjs "script return fix" Branch.

Message from @maggiolo00:

I've pushed the fix in this branch

https://github.com/orientechnologies/orientjs/tree/script-return-fix

I've also added more test in script-test.js

If you want to test it you should grab the latest 2.2.9 snapshot of orientdb here

@wolf4ood wolf4ood self-assigned this Aug 30, 2016
@wolf4ood
Copy link
Member

@EricLin2004

as @StarpTech said

the branch contains the fix in orientjs side and it works with 2.2.9-snapshot.

@StarpTech
Copy link

@EricLin2004 @maggiolo00 I don't validate the fix I will do it in the next days.

@wolf4ood
Copy link
Member

wolf4ood commented Aug 30, 2016

Ok @StarpTech

let me know and then i will move the fix in master.

Thanks

@EricLin2004
Copy link
Author

Thanks @StarpTech , @maggiolo00 for the quick responses. Looks good to me.

I have a workaround for now with 2.2.8 on my production server though so I'll probably wait for the official release of 2.2.9 before updating it again.

Feel free to close this issue ?

@wolf4ood
Copy link
Member

@EricLin2004

i will close it once the fix is ported to master branch

Thanks

@wolf4ood wolf4ood added this to the 2.2.x (next hotfix) milestone Aug 30, 2016
@wolf4ood wolf4ood added the bug label Aug 30, 2016
@StarpTech
Copy link

StarpTech commented Sep 3, 2016

HI @tglman @maggiolo00 Bad News, with the version "script-return-fix" I run into big problems. I get same results (same RIDS) for two different querys:
Both records exists and the query works fine in studio.

begin
LET t0 = SELECT @rid as rid, SponsoredBy.@rid as sponsorRid FROM Node WHERE Mid = '550f0966dea0acda617337e6'
LET t1 = SELECT @rid as rid FROM Node WHERE Mid = '5681ee64b5c1421c28131f69'
commit retry 100
return [$t0,$t1]

When I try it with 2.1.x and orientjs 2.2.2 it works.

Could it be a regression https://github.com/orientechnologies/orientjs/blob/f778b7c1d99a7497af359a228e49c56f00182381/test/bugs/186-resolveReferences-duplicates.js ?

@tglman
Copy link
Member

tglman commented Sep 5, 2016

Hi,

We just fixed this case, here is the commit : orientechnologies/orientdb@266fa85

Regards

wolf4ood added a commit that referenced this issue Sep 6, 2016
@wolf4ood
Copy link
Member

wolf4ood commented Oct 28, 2016

@EricLin2004 @StarpTech
i've released a new version of OrientJS (2.2.3) with a fix for this multiple return.
If it's not covered please reopen it
Thanks

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

No branches or pull requests

4 participants