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

@CurrentTimestamp #49

Open
lukasj opened this issue Feb 23, 2013 · 8 comments
Open

@CurrentTimestamp #49

lukasj opened this issue Feb 23, 2013 · 8 comments

Comments

@lukasj
Copy link
Contributor

lukasj commented Feb 23, 2013

New annotation "@CurrentTimestamp" should inject the current timestamp of a transaction into a data field.

The annotation will guarantee that at the transaction start the timestamp is produced once, so all uses of the annotation within the same transaction will guarantee to inject the same timestamp value.

This is another essential business need, as sometimes transactions run rather long, but all written data shall have synchronized timestamps.

@lukasj
Copy link
Contributor Author

lukasj commented Feb 23, 2013

@glassfishrobot Commented
Reported by mkarg

@lukasj
Copy link
Contributor Author

lukasj commented Feb 23, 2013

@glassfishrobot Commented
Parent-Task: JPA_SPEC-36

@lukasj
Copy link
Contributor Author

lukasj commented Nov 24, 2016

@glassfishrobot Commented
rbygrave said:
Personally I'd argue for 2 annotations like @WhenCreated and @whenupdate. I've already mentioned this in #48 wrt SQL2011 History support and auditing etc. Just adding this comment here in case ... something happens !!

@lukasj
Copy link
Contributor Author

lukasj commented Nov 25, 2016

@glassfishrobot Commented
neilstockton said:
+1 for @CreateTimestamp and @UpdateTimestamp, and with both taking the timestamp at FLUSH. The reason to use flush timestamp is that with updates you may have multiple updates of an object in a transaction, so need to distinguish which update.

@lukasj
Copy link
Contributor Author

lukasj commented May 5, 2017

@glassfishrobot Commented
This issue was imported from java.net JIRA JPA_SPEC-49

@lukasj
Copy link
Contributor Author

lukasj commented Jul 4, 2017

@andyjefferson Commented
FWIW, DataNucleus implements this as 2 new annotations @CreateTimestamp and @UpdateTimestamp.

@lukasj
Copy link
Contributor Author

lukasj commented Aug 31, 2018

@andyjefferson
Copy link

These annotations should be applicable for fields of type java.sql.Timestamp, or java.time.Instant.

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

No branches or pull requests

2 participants