transactions

Can one (repeatedly) restructure a Firebird table in a single transaction?

孤街浪徒 提交于 2020-01-26 04:07:04
问题 Normally, I'd do a relatively complicated change of data type on column A like this: Create column B of the new data type Set B to contain the new values derived from A Drop A Rename B to A To guarantee the validity of my data model, I'd like to perform such restructuring within a single transaction. So far, I have not been able to do that, because, depending on the isolation level, either B is not considered to exist yet, or I'm not allowed to rename B ("update conflicts with concurrent

What data is locked by @Transactional annotation?

匆匆过客 提交于 2020-01-26 04:00:29
问题 I need to implement an MVC web service. I selected Spring MVC/Data JPA for this purpose So my service need to: Load some entities Make some business logic on it Update the entities and store it All above need to be in atomic manner Some code snippet to clarify: @Service public class AService { @Autowired private Repository1 repository1; @Autowired private Repository2 repository2; @Autowired private Repository3 repository3; @Transactional public Result getResult(Long id) { Entity1 e1 =

firebase transaction on lower node - Maximum call stack size exceeded

依然范特西╮ 提交于 2020-01-25 11:28:33
问题 after several Q&A about the transaction mechanism I'm trying to run a transaction on a lowel node here is my data: activeOffers -LKohyZ58cnzn0vCnt9p details direction: "city" seatsCount: 2 timeToGo: 5 uid: "-ABSIFJ0vCnt9p8387a" ---- offering user I'm trying to run the transaction on -LKohyZ58cnzn0vCnt9p and do the following: decrease the seatsCount by some requested value if there is enought seats add a subnode deal under ** -LKohyZ58cnzn0vCnt9p** with the requested value and the uid of the

Fastest and Safest Way to Emulate Auto-Increment using MAX in InnoDB

白昼怎懂夜的黑 提交于 2020-01-25 10:17:07
问题 Assume that we have a table with the following schema: CREATE TABLE Persons ( sid int NOT NULL AUTO_INCREMENT, groupName varchar(255) NOT NULL, userIdInGroup int, PRIMARY KEY (sid)); We want to assign each new user in the same group an auto-increment userId based on the last userId of the group, i.e. we want to emulate an auto-increment userId within each group. Since we are inserting the new userId considering the MAX(userIdInGroup) we need to wrap select and insert in a transaction.

Best way to manage transactions

你离开我真会死。 提交于 2020-01-25 04:08:09
问题 I've the JBoss and Hibernate based system. And I need to process two long operations. Operations can be probably longer than transaction's timeout. It operations are persists many-many entities, in two different transactions. And if something goes wrong, during this operations, I should rollback all changes of the transactions. What's the best way to resolve it? I think, the best way is merge all operations to one transaction, but it requires to set LOng transaction timeout, and it

Which PAYPAL service is better for online transaction for website?

会有一股神秘感。 提交于 2020-01-25 03:19:05
问题 I am working on a website where users will have to pay to use some services. So I know that PayPal is the service I can use. User can pay with debit card, credit card, PayPal account etc. I know that PayPal button can be used for it. But in my website, I want to give user an option to add amount of their choice. User can pay $5 or $50,000 or anything they want. I don't know if I can use PayPal button or not for this. In short user will enter amount in form. After submitting the form, it will

OOP & Transactions between objects JAVA

☆樱花仙子☆ 提交于 2020-01-24 20:59:07
问题 i hope somebody can help me with this, i have 2 clases User and Adress both have addNewUser() and addNewAdress() this methods do a transactions with preparedsatement, but i dont know how to join the objets because when i add a new user i need to add a new adrees with the user id. class User{ public boolean addNewUser(){ Connection con = conecctions.getconnection; Statement stmt = null; Boolean result = false; try { stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR

Error while indexing in Hibernate Search (before transaction completion)

自闭症网瘾萝莉.ら 提交于 2020-01-24 18:16:11
问题 I am tired of banging my head around this problem So if anyone could suggest me where I am wrong I'll be grateful. The problem is I am using Spring-Batch and Hibernate Full-Text Search in my Spring MVC project.So from the batch job Tasklet I am calling following code: A a=aDao.merge(a); b.setA(a); bDao.save(b); While doing the save update on these entites I am getting an exception and the stacktrace is as follows: org.springframework.orm.hibernate3.HibernateSystemException: Error while

proper way of writing FunctionalTest in playframework

徘徊边缘 提交于 2020-01-24 14:40:07
问题 While writing FunctionalTest for a webapp based on play1.2.4,I was a little confused as to how to code it properly.The confusion is regarding the transaction boundary involved.I read somewhere that each test has its own transaction. In my app,a User can login and add some items to the cart.Then he can give an Address sothat the items can be sent to him. I created private helper methods like below private Cart buyItemsAsCustomer(String email,String pass) { User user = User.find("byEmail",

Handling Transaction Between Paypal and Local Datasase

前提是你 提交于 2020-01-24 13:34:28
问题 What is the best practice to handle transaction between application and paypal. Consider: I'm Alice and I want send money to Bob In my DB I see that Bob has $200 and I want to send him $150. Once transaction is sent I want to update the Bob's account such that it would contain $50. Now according to PayPal API I can send Pay and receive success. However what happens if I for example send Pay it succeeds but I fail to receive a response due to network problem. So I assume that error happened