We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
@Transaction <span>public</span> <span>void</span> transferMoney(<span>Long</span> start, <span>Long</span> destination, <span>Double</span> cost) { <span>if</span> (start.getCost < cost ) -> <span>throw</span> exception(Bạn k đủ tiền) <span>try</span> { trừ tiền của start gọi API phía destination cộng tiền cho destination } <span>catch</span> { <span>throw</span> lỗi roll back DB của start gọi API trừ tiền của end } }
transaction.begin: thực tế là execute query: set auto commit = false cộng trừ tiền transaction.commit: commit kết quả vào db
2.2K Point(s)
1.2K Point(s)
313 Point(s)
178 Point(s)
138 Point(s)
Input your email to receive reset password link, or if you remember your password, you can click