You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Many of our API's would benefit if we designed to use JTA transactions API #2063
We should consider this for Spanner, PubSub, and other API's, however, it might need updating the product API's to support this, so it may be a moot ask.
RayT recently wrote wrote:
That's a good start. In short, a hook would at least have begin transaction, commit, and abort/recover semantics.
Otherwise, another pattern would be temporarily writing the pub/sub message into a transactional store (e.g., via JDBC into a database), and have another background process that can guarantee delivery and do all the retries, etc.
That being said, how does Google deal w/ similar cases? Perhaps we recommend people not to do this (that's my guess), but we need to recommend alternatives.
changed the title [-]Many of our API's would benefit if we designed to use XA transactions API[/-][+]Many of our API's would benefit if we designed to use JTA transactions API[/+]on May 31, 2017
@saturnism I was looking at the JTA transaction interface. There are methods there which are needed for supporting distributed transactions which Spanner does not support.
Does it still make sense to implement this interface and just implement the commit and rollback functionality and throw UnsupportedException for other methods? Are there other databases which do this? Without XA support, is implementing this still useful?
Odds are that if we don't do a bunch of other stuff, this isn't helpful by itself. In looking at SpringBoot, it appears to support jta w/ XA in a fewcasesmore
@lesv I'm not sure what you mean by "if we don't do a bunch of other stuff, this isn't helpful by itself". Distributed transactions are very commonly used in the enterprise, especially for things like read a message from a queue (think Pub/Sub) and update a database (think Cloud SQL). I think Cloud SQL is covered with the JDBC driver, but I don't think there is currently a way for Pub/Sub to participate in a distributed transaction. It doesn't even seem to have a concept of a transaction. At least once delivery, is all you get. Providing something on top of Pub/Sub to simulate transactional semantics, would be a lot of work. Maybe that's what you mean by "a bunch of other stuff".
Activity
saturnism commentedon May 25, 2017
If not XA, start w/ just JTA
lesv commentedon May 31, 2017
I sent an email about this recommending JTA with some specs.
[-]Many of our API's would benefit if we designed to use XA transactions API[/-][+]Many of our API's would benefit if we designed to use JTA transactions API[/+]lesv commentedon May 31, 2017
I know of two customers who would like this - who asked in the last 30 days.
garrettjonesgoogle commentedon Aug 10, 2017
This has been added to our feature backlog: https://github.com/GoogleCloudPlatform/google-cloud-java/wiki/Feature-backlog . This issue will be closed but is linked in the backlog and can continue to be used for comment and discussion.
vkedia commentedon Aug 22, 2017
@saturnism I was looking at the JTA transaction interface. There are methods there which are needed for supporting distributed transactions which Spanner does not support.
Does it still make sense to implement this interface and just implement the commit and rollback functionality and throw UnsupportedException for other methods? Are there other databases which do this? Without XA support, is implementing this still useful?
lesv commentedon Aug 22, 2017
Odds are that if we don't do a bunch of other stuff, this isn't helpful by itself. In looking at SpringBoot, it appears to support jta w/ XA in a few cases more
@meltsufin may have thoughts.
meltsufin commentedon Aug 23, 2017
@lesv I'm not sure what you mean by "if we don't do a bunch of other stuff, this isn't helpful by itself". Distributed transactions are very commonly used in the enterprise, especially for things like read a message from a queue (think Pub/Sub) and update a database (think Cloud SQL). I think Cloud SQL is covered with the JDBC driver, but I don't think there is currently a way for Pub/Sub to participate in a distributed transaction. It doesn't even seem to have a concept of a transaction. At least once delivery, is all you get. Providing something on top of Pub/Sub to simulate transactional semantics, would be a lot of work. Maybe that's what you mean by "a bunch of other stuff".
You can read about Spring support for distributed transactions here: https://spring.io/blog/2011/08/15/configuring-spring-and-jta-without-full-java-ee/
olavloite commentedon Dec 17, 2017
@lesv I have added support for XADataSource and XAResource to my open source JDBC driver for Google Cloud Spanner, and also made a small sample application by modifying the example from Spring Boot.
deps: update dependency com.google.cloud:google-cloud-shared-dependen…
chore(main): release 2.34.2 (#2067)
deps: update dependency org.springframework.boot:spring-boot-starter-…
docs(samples): Optimistic subscribe sample (#2063)
chore(main): release 1.133.0 (#2206)
docs(samples): Optimistic subscribe sample (#2063)
chore(main): release 1.133.0 (#2206)
chore: Create renovate_config_check.yaml (googleapis#1920) (googleapi…