Optimisticlockdemo
Demo showing how to accomplish optimistic locking with JPA and a custom implementation
Install / Use
/learn @nburana/OptimisticlockdemoREADME
Optimisticly Locking Your Spring Boot Services
This project details two ways you can optimisticly lock you web services.
- With built in mechanisms provided by the JPA specification and the Hibernate provider.
- With a custom annotation and annotation processor for cases where your ORM does not support optimistic locking. In our case we're using Spring JDBC.
Start up your Spring Boot app by running the server.sh file.
During startup, Spring Boot will initialize an in memory database and create our products table for us. It will also insert a record for us to work with.
Database console access
The database can be accessed through the browser at http://localhost:8080/h2-console. No password necessary. This database serves both the JPA and JDBC examples.
Running the JPA based example
To run the JPA example, execute scripts/test-jpa.py
Running the JDBC based example
To run the JPA example, execute scripts/test-jdbc.py
Related Skills
node-connect
348.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
