Questions tagged [transactions]

1

votes
2

answer
518

Views

two phase commit in nodeJS application

I am currently working on a nodeJS application that will soon need to write simultaneously on two PostgreSQL databases. This is meant for redudancy purposes: the writing operations must be made in the same time on both databases, or rollbacked if there is anything wrong with one of the databases. In...
Pikuni
0

votes
0

answer
2

Views

How Spring Transaction behaves differently in different layer(service/repository layer)

Hi I need the following clarification on spring transaction. Seen is like: Service1.java @Service @Repository public class Service1 { @Autowired EmployeeRepo employeeRepo; @Autowired Repo repo; @Transactional public void m() { employeeRepo.save(new Employee(5, 'N3', 33, 3000)); repo.m1(); //M1 //m1...
Joe
1

votes
3

answer
3.2k

Views

How to handle if DbTransaction's Commit() or Rollback() throw exception?

I am working with Visual Studio 2012 and MS SQL Server 2008 R2. In my code I am using DbConnection and DbTransaction. This is my code: DbConnection dbConnection = null; DbTransaction dbTransaction = null; try { dbConnection = DbProviderFactories.GetFactory('System.Data.SqlClient').CreateConnection()...
ChumboChappati
1

votes
1

answer
2.7k

Views

Kafka - Idempotent producer in “exactly once delivery” semantic

From last version of Kafka (0.11.0.0) released the 28th of June 2017, the kafka team provided new features in order to support exactly once delivery. After I downloaded the latest version I tried configuring the Producer (executed through kafka-console-producer.sh script) as described in Producer co...
rh0x
1

votes
1

answer
413

Views

SQL Server transactions errors due to different Isolation Levels

I created the following stored procedure in order to examine the isolation level behavior in transaction: CREATE PROCEDURE ReadCommittedIsolationLevel AS BEGIN BEGIN TRANSACTION t1 BEGIN TRY EXEC SnapShotIsolationLevel COMMIT TRANSACTION END TRY BEGIN CATCH PRINT ERROR_MESSAGE() ROLLBACK TRANSACTION...
Offir Pe'er
1

votes
1

answer
25

Views

In InnoDB,is all sql in the transaction?

I seems have a wrong idea that : update table_name set id=222 where id >333; my old opinion is above single sql without begin and commit will not start a transaction. but it seems wrong. But when i read the mysql doc,i found that seems that all sql will in a transaction.if you do not explicit use...
Mattia Dinosaur
1

votes
1

answer
45

Views

ArangoDB: Transaction restrictions within Foxx service

I'm trying to find documentation describing restrictions on what can be safely accessed from within a transaction running within a javascript Foxx micro-service. I had read somewhere (can't find it now) that you can't access anything except what is passed via the transaction parameters array, and yo...
Dale
1

votes
1

answer
36

Views

node redis - id generation race condition

Multiple processes have access to my redis store. When adding a new user hash, I do the following steps: incr userId set user:[the incremented userId] ... How can I bundle these steps into a transaction? const client = require('redis').createClient(); client.on('connect', () => { const multi = clien...
nagy.zsolt.hun
1

votes
3

answer
372

Views

Spring @Transactional annotation making my class not able to Autowire

I have a class SaveRoute which has got an auto-wired property SaveProcessor. This SaveProcessor class has got a method which is annotated with @Transactional annotation. When I try to run my application, Java is throwing an exception that bean SaveProcessor dependency injection failed. When I remov...
Jewel Jose
1

votes
1

answer
77

Views

Content Provider transaction around multiple methods

I need to create a Content Provider transaction around two methods that I didn't create but should use. Method addDog(Context, Dog) throws Exception adds a row in the Dog table. Method addToy(Context,Toy, long dogId) throws Exception adds a row in the Toy table. I would like to create a method publ...
salyela
1

votes
0

answer
116

Views

How to do Transaction begin and commit in different methods of different classes?

For e.g. A.php class A{ public function abc(){ DB::beginTransaction(); $result = Model::save(); } } B.php class B{ public function cde(){ DB::commit(); //or DB::rollback; } } These are two classes from different files. Steps : $a->abc() first will get called then payment operation then $b->cde() w...
Rahul Meshram
1

votes
0

answer
34

Views

C# TransactionScope - keep state cliente x server

I'm in a project to upgrade a application from visual basic 5 to ASP.Net MVC. In a specific screen, the user fills a lot of information about a product and activates the save function. In the save function there are a TransactionScope to control transaction between the database upgrades. After inse...
1

votes
1

answer
144

Views

What is the relationship between outer transaction and inner transaction?

I am new to Hibernate and when I am using transactions I met couple of questions. Previously, the situation is @Transactional Class A { methodA1(){ DOs = fetchDOsFromDB(); methodA2(DOs); } methodA2(DOs){ ClassB.methodB1(DOs); } } Class B{ @Transactional(propagation = Propagation.REQUIRES_NEW) method...
yilia
1

votes
0

answer
47

Views

Ruby on Rails Rollback except a given model

I am running on Rails 3.2.22 and I can't get transaction/rollback working. This code should always print 'WORLD' but actually, it will never work if raise is called. But according to Rails doc, it should always reach there. My question is - is there a way how to save @pb status into a database? If I...
George Morris
1

votes
0

answer
35

Views

Refresh/Access updated Entities outside the transaction in Spring

I am spawning a newSpring transaction inside a readonly Spring transaction. The new transaction is creating an entry in DB. After coming out of the new transaction I am not able to fetch the data in the readonly transaction, though the entry has been created in the DB at that point. Interface A { @T...
nikhilsuri
1

votes
1

answer
663

Views

Transaction configure failed in Spring Boot

update: I found that I inject class A into class C which extends an external class, and that class didn't managed by spring, like this: public class C extends ExternalClass { @AutoWired private A a; //doSomething... } That should be the main cause of transaction failure. Another question:...
NeB Nep
1

votes
1

answer
202

Views

Spring transaction did not correctly rollback

@RunWith(SpringRunner.class) @CustomTestContext public class TransactionalTest { @Autowired private UserRepository userRepository; private Log logger = LogFactory.getLog(getClass()); public void doSomething() { try { User user = new User(); user.setUsername('test'); // username has unique constraint...
zl2003cn
1

votes
2

answer
278

Views

How to broadcast raw transaction using bitcoin-ruby?

How to broadcast raw transaction using bitcoin-ruby? I used bitcoin-ruby gem from https://github.com/lian/bitcoin-ruby Bitcoin.network = :testnet address='muLGqMS6tkqb9sBQ4sqeXjMzaV8rk8o3gv' url = 'https://testnet.blockexplorer.com/api/addr/#{address}' uri = URI(url) response = Net::HTTP.get(uri) if...
Ayan Nurbolat
1

votes
0

answer
129

Views

Spring: Doing delete and create in same transaction so that rollback happens if any of them fail

I am trying to do delete and create of a pojo from inside the component. First I do the delete and then call save to create it again. The problem is that when the save fails, the delete isn't getting rollbacked. @Transactional public Item itemDeleteAndCreate(@NonNull Item itemToUpdate, Long itemId,...
Arpan Agrawal
1

votes
1

answer
328

Views

Get the transaction id when the transaction is committed

I am using IEnlistmentNotification interface from transaction scope and I want to access the current transaction id in the commit method after the scope is completed like this: public void Commit(Enlistment enlistment) { string transactionId = Transaction.Current.TransactionInformation.LocalIde...
chana
1

votes
0

answer
847

Views

Sending a signed transaction to deploy a contract (Ethereum)

My goal is to send a signed transaction to create a smart contract, however, I am facing an issue I have not been able to solve for few days: When I send the transaction (on a private chain), there are two different ending: - 1 Web3js tells me it worked, I can see the transaction on the block. Howe...
Andromelus
1

votes
1

answer
103

Views

Concurrency in java spring : @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.SERIALIZABLE) not working

I am developing a java (spring/hibernate) application which is kind of a timed and quantity limited sale platform .i.e I have to sell only 1000 cards of a type in the time slot of 10am-11am. I get around 150 000 requests in around 3 seconds and I end up selling more than 1000 cards, sometimes 1150,...
Ritzz
1

votes
0

answer
828

Views

Spring boot 2 Transaction managers and 2 @Transactional

I have Spring boot with two databases (first and second). I have this working configuration: @Bean public DataSourceTransactionManager firstDbTransactionManager(@Qualifier ('primaryDataSource') DataSource datasource) { return new DataSourceTransactionManager(datasource); } @Bean public DataSourceTra...
Adeptius
1

votes
2

answer
180

Views

Distributed Locking

I have 3 Process (P1, P2, and P3) each running on different machines. These process share 3 tables (T1, T2 and T3) in database. While updating these tables I need to maintain the atomicity of 3 tables at once ( Either all tables should be modified or none of the tables should be modified). My databa...
Kishor Bhandari
1

votes
0

answer
56

Views

Is it possible to create a Lost Update with MySQL Workbench

I want to create a Lost Update with MySQL Workbench. Therefore, I have 2 connections to my database and 2 transactions. I also changed the transaction isolation level to read uncommitted but transaction A uses the current data when the update statement starts. It never uses the data from the first s...
tk5
1

votes
0

answer
231

Views

Using Azure Servicebus queue with Camel in transactional mode

I already setup a connection to an Azure Servicebus queue with camel-amqp successfully and could read messages from it. Then I tried to switch to transactional mode. This time, it fails with the following warning, which will be repeated every 5 seconds: c.c.j.DefaultJmsMessageListenerContainer : Set...
tycrox
1

votes
1

answer
134

Views

TransactionSynchronizationRegistry vs TransactionSynchronizationManager

I have an application running no weblogic with ejb, with JTA provided by WLS. Now I am trying to adapt all application to work in tomcat without ejb, using spring instead. Also will use JPATransactionManager that spring provides, instead of JTA. I used to use TransactionSynchronizationRegistry.getTr...
liotur
1

votes
1

answer
75

Views

Corda: many depended transaction in one flow can lead to inconsistency

I have two transactions in flow. Second transaction are depend on first. Example scenario is: First transaction ended successfully Based on results form first transaction I create a second one Second transaction fail for some reasons I'm worry about consistency here. I need to keep this two separate...
Szymon Grzelak
1

votes
1

answer
953

Views

Spring Boot aop tx advice in java config without xml config

I have Spring boot application with Atomikos and JOOQ (with multiple data sources db1 & db2) I have XML configuration like below and I want to convert it to java config. I have seen some stackoverflow question already asking this question, but they're old and haven't found any solution. JavaConfig:...
D7thename
1

votes
0

answer
350

Views

Problème d'identification du commerce. Accès refusé ! E-Transactions/Paybox

I'm having an issue running payments with Paybox via e-transactions system from Crédit Agricole (French bank). I have no issues with the variables i'm sending through the form, which is the following: I have set up the HMAC this way: def paiement @commande = Commande.find_by(code: params[:id]) @con...
justinedps26
1

votes
1

answer
178

Views

Counterparty flow on C=GB,L=London,O=Controller had an internal error and has terminated at

net.corda.core.flows.UnexpectedFlowEndException: Counterparty flow on C=GB,L=London,O=Controller had an internal error and has terminated at net.corda.node.services.statemachine.FlowStateMachineImpl.erroredEnd(FlowStateMachineImpl.kt:446) at net.corda.node.services.statemachine.FlowStateMachineImpl....
Ravikumar
0

votes
1

answer
15

Views

Get data copied by a function

I have a quite complicated data structure that lies in several tables. I have a function that makes a copy of that structure. I want to make a copy and get newly created data in a single query like this: SELECT * FROM main_table JOIN other_table ON (main_table.id = other_table.main_id) WHERE main_ta...
Adam
0

votes
0

answer
4

Views

Unsure of what to return for Firebase Transaction

Currently, I am setting a user's username after they have signed up. I realized, however, that simply observing whether the username existed or not wasn't the correct solution; instead, I needed to run a transaction. However, there are multiple observers within the transaction so I am unsure what ex...
Raim Khalil
1

votes
1

answer
159

Views

How to properly handle money transactions with MySQL?

I have the following tables: CREATE Account (id INTEGER, balance DECIMAL(13, 4)) CREATE Transaction (id INTEGER, user INTEGER, balance DECIMAL(13, 4), amount DECIMAL(13, 4), peer INTEGER) So when a user transfers money to his peer, there will be 2 transactions in the system (1 for each) and both acc...
Gilad Novik
1

votes
2

answer
169

Views

Sql server. The current transaction cannot be committed and cannot support operations that write to the log file

begin tran begin try select case when 1=0 then 0.0 else '' end --this will not work end try begin catch --error has occured. But it doesnt matter. We want to continue anyway end catch select 1 --do something else commit --unfortunatelly this producess error 'The current transaction cannot be committ...
1

votes
2

answer
86

Views

Google Datastore Transaction API vs. Datastore API when in a transaction

I have been battling Google Cloud Datastore transactions for two days. I am unsure whether or not I should use datastore.save or transaction.save when within a Google Datastore transaction. Common code: const datastore = new Datastore(); const transaction = datastore.transaction(); Scenario 1: tran...
jcgh582
1

votes
2

answer
223

Views

Transaction management of JPA and external API calls

I'm new to spring, started using spring boot for the project. We have an use case of implementing database changes and few external API calls as one transaction. Please suggest, is this possible with the spring @transactional?
user1138703
1

votes
0

answer
771

Views

Spring @Transaction wrapped around lambdas?

In a method like this, will the transaction be applied to all of the orderLineRespository.insertOrderLine() calls inside the lambda? @Transactional public OrderResponse createOrderTransactional(Order order) { checkForSomething(customerOrder); order.getOrderLines().forEach(line -> orderLineRepository...
bitstream
1

votes
0

answer
82

Views

BlockCypher Account nonce too far behind transaction

I'm currently working on a DApp that involves sending transactions. I'm using BlockCypher to send the transactions since the API is fairly straight forward. One issue I'm finding is that when I run my API locally and call the send transaction method I receive the transaction hash and I'm able to che...
SwimmingG
1

votes
0

answer
129

Views

How to use transactions with C# and Sybase

I have done plenty of transaction processing in .net using both VB and C# when accessing SQL server. But I can not get the transaction process to work when using odbc with Sybase. I found somewhere where I need to 'SET CHAINED OFF', I have done that, but no matter what after calling my insert proce...
rnesolydev

View additional questions