Git Product home page Git Product logo

Comments (13)

StarpTech avatar StarpTech commented on August 15, 2024 2

Look in the tests https://github.com/arangodb/go-driver/blob/master/test/database_transaction_test.go

from go-driver.

StarpTech avatar StarpTech commented on August 15, 2024 1

@ewoutp this is not bearable. Arangodb looked so promising and then this.

Who wants to write transaction in javascript in form of a string when you are familiar with PHP, Go or even Javascript? The other downside is that you can't interact with your business logic or other services. Neo4j provides one query language to update, query nodes and edges. If you want to start a transaction you can do it via multiple cypher querys over HTTP or Bolt. I really don't understand why Arangodb took this path.

The other point is that arangodb is not capable to provide full ACID support on queries with multiple documents here the whole transaction feature feels like marketing joke but I hope you will rock it. Arangodb is still a great product.

from go-driver.

TimelyToga avatar TimelyToga commented on August 15, 2024 1

@ewoutp Now that v3.5 has introduced stream transactions, will this feature be added to the go driver?

from go-driver.

vanobig avatar vanobig commented on August 15, 2024

I'm a little bit confused after looking at the tests. So, yes, "action" parameter is a string, which is a JavaScript closure.

Can anyone explain how I'm supposed to integrate this into my app? Am I supposed to construct a JavaScript code in Go now? What if I have a business logic spread across multiple services/classes (reading and writing into different collections), how do I consolidate it all in a JavaScript string?

from go-driver.

StarpTech avatar StarpTech commented on August 15, 2024

Yep, seem so https://github.com/arangodb/go-driver/blob/master/database.go#L58 It looks like that only javascript is supported but this is documented here https://docs.arangodb.com/3.3/Manual/Transactions/TransactionInvocation.html#execute-transaction

I'm a little bit confused too. Aren't we able to write transaction with the language and tools of the client driver? Hacking this in javascript is cool but the tooling is very bad. We receive no instant feedback when we write code and debugging is hard. What's the big deal with this?

from go-driver.

ewoutp avatar ewoutp commented on August 15, 2024

I'm a bit sad to say that for now the answer is yes. You have to write your transaction in JS and pass that as a Go string to the driver.
The reason for that is that the ArangoDB API (see docs link mentioned above) supports transactions in JS only. This enables the server (or cluster) to re-execute the entire transaction automatically if it needs to retry for whatever reason).
We hope to support a more traditional style of transaction in the future with an all-Go solution.

from go-driver.

weinberger avatar weinberger commented on August 15, 2024

from go-driver.

vanobig avatar vanobig commented on August 15, 2024

@weinberger I think there is no misunderstanding here. It's clear that AQL is transactional. In the mean time, number of cases when multi query transaction is needed is significant large. Unfortunately, being forced to write business logic in JS while using Go is not sustainable.

from go-driver.

weinberger avatar weinberger commented on August 15, 2024

from go-driver.

vanobig avatar vanobig commented on August 15, 2024

Understood, and thank you for letting me know.
What do you suggest @weinberger? Do you want me keep the ticket open or should I close it?

from go-driver.

ewoutp avatar ewoutp commented on August 15, 2024

@vanobig I'm closing the issue now. Feel free to re-open if needed

from go-driver.

snmed avatar snmed commented on August 15, 2024

Is there any chance to get a multi query example with a transaction in the documentation? How has the javascript query look like to commit or rollback the transaction?

Cheers sandro

from go-driver.

maja42 avatar maja42 commented on August 15, 2024

I can see that there are methods BeginTransaction, CommitTransaction and AbortTransaction.
But there is no documentation anywhere that I could find.

How am I supposed to use those functions? Am I supposed to use those functions?

from go-driver.

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.