Comments (13)
Look in the tests https://github.com/arangodb/go-driver/blob/master/test/database_transaction_test.go
from go-driver.
@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.
@ewoutp Now that v3.5 has introduced stream transactions, will this feature be added to the go driver?
from go-driver.
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.
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.
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.
from go-driver.
@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.
from go-driver.
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.
@vanobig I'm closing the issue now. Feel free to re-open if needed
from go-driver.
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.
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)
- If I want to create a database, should I always use the root user? HOT 2
- bindVars for an array HOT 1
- Ensure***Index are unclear ? HOT 5
- How to use velocypack in go-driver? HOT 7
- user with limited access rights: client.Database error EOF HOT 2
- Streaming Transactions HOT 3
- [Bug] Unable to create nested object in ArangoSearch view definition
- Arango db Go Driver Tutorial page not found HOT 1
- Use case to re-enable Velocypack encoding for _api/gharial HOT 2
- Add a Ping() method HOT 3
- Use cases to expose getters for Context values HOT 2
- Results of aggregate sum cannot be unmarshaled into int64/time.Duration HOT 2
- 401 and 503 for not leader for different request HOT 5
- [FEATURE] Get raw result from cursor and add a Next method to a cursor to iterate results batch by batch HOT 4
- Collections not removed when used in an EdgeDefinition HOT 1
- which type should be injected ? HOT 1
- Initialise Database struct without sending requests to the cluster HOT 7
- Conflict error should expose the name of a field that violates a unique constraint.
- go.mod:6:2: require github.com/arangodb/go-driver: version "v2.0.3" invalid: should be v0 or v1, not v2
- DatabaseExists and CollectionExists return non-nil error value when it doesn't exist (it's not supposed to do that) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-driver.