spring-attic / spring-cloud-gcp

Integration for Google Cloud Platform APIs with Spring
Apache License 2.0
705 stars 693 forks source link

Spring Data Spanner: Get commit timestamp after successful commit #1622

Open don-mayur opened 5 years ago

don-mayur commented 5 years ago

It would be great if we can get CommitResponse and timestamp of it, whenever write happens in transaction and LastUpdateTimestamp column which has allow-commit-timestamp=true enabled. Google spanner have docs for RPC which suggests its available with the calls RPC Docs. Also it is available in client library as well and can be found in Spanner Repo.

meltsufin commented 5 years ago

@ChengyuanZhao

ChengyuanZhao commented 5 years ago

@don-mayur I'll look into the CommitResponse.

The last-updated timestamp column feature is already available. Check the refdoc here https://github.com/spring-cloud/spring-cloud-gcp/blob/master/docs/src/main/asciidoc/spanner.adoc#columns spannerCommitTimestamp

don-mayur commented 5 years ago

@ChengyuanZhao Thanks for suggesting column option spannerCommitTimestamp which is helpful and I will use it, But in this issue I was referring about ability to retrieve commitTimestamp after successful transaction commit as a CommitResponse and way to get it, without again querying the database. Please see example in Spanner Git Repo for this.

meltsufin commented 5 years ago

@ChengyuanZhao Do you have an update on this?

ChengyuanZhao commented 5 years ago

@meltsufin no response at the moment. This is a feature request we haven't looked into or implemented yet.

EDIT: I think it's rather more low-level than we have a space for. I'm not entirely sure it's appropriate to put into the API/interface. I think we can close this and re-open if it's in demand.

mescanne commented 3 years ago

There is a Spanner customer who is interested in this -- is this a lot of work? Should we just file a new feature request?

ahoqueali commented 3 years ago

Hi @ChengyuanZhao, this feature is very important for us. Please try to get it prioritised.

elefeint commented 3 years ago

I'll take a look. I've recently been in the client library code dealing with this.

elefeint commented 3 years ago

Sorry, will look in the new year. Ran out of time.