Cancel Transaction on Aurora Bridge - cryptography

Can I cancel a transaction on Aurora and Rainbow Bridge? The transaction requires too much gas. I am afraid I have lost my funds.

Once confirmed on the blockchain, the transaction on Aurora’s trustless Rainbow Bridge cannot be cancelled.
If the fee is too high at the moment, you can wait for the ETH gas prices to go down and finalize the transaction at any time in future.

Related

Does a cryptocurrency wallet blockchain need to be fully synched before it can be mined?

I have a mining pool that is going to take several days to synch the blockchain, I'm wondering if I can have miners mining on it before the blockchain synchs or if I have to wait before blocks will be generated. I suspect that I do, but perhaps this lovely site will erase that suspicion entirely :)
Are you talking about bitcoin network or any private blockchain network?
Yes, you have to sync entire blockchain wallet.
As we know that mining is the process of adding transactions to the large distributed public ledger of existing transactions and cryptocurrency wallet blockchain remains in syncing process automatically.
Mining and syncing of blocks works simultaneously, can you please explain what you exactly want to achieve?

2 Phase Commit Global Transaction Status after 2nd Phase failure

My question is this:
Say I have a Transaction Manager and 2 Resource Managers.
TM tells RMs to prepare.
RMs acknowledge they are prepared/vote yes.
TM tells RMs to commit.
RM 1 commits and acknowledges commit.
RM 2 never gets the commit message because of network failure.
In this scenario I know that RM 2 is sitting in a waiting state, then the session times out in the database and is put into in-doubt state.
If the TM does not reconnect with the RM before the AbandonTimeout is exceeded, then the transaction is abandoned.
My question is, what happens to the global transaction while the TM continues to attempt recovery of the RM?
Does the TM send back an exception to the application when it starts trying the recovery?
Does the TM send back success even though one of the RMs never sent an acknowledgement?
The AbandonTimeout is default of 24hours. Does the TM hold the transaction for 24 hours and then once the timeout is reached, send back an exception?
In this link 2 phase Commit the end of phase two states:
The coordinator sends a commit message to all the cohorts.
Each cohort completes the operation, and releases all the locks and resources held during the transaction.
Each cohort sends an acknowledgment to the coordinator.
The coordinator completes the transaction when all acknowledgments have been received.
So what happens to the global transaction if the acknowledgement of the commit is never received?
I cannot find anything surrounding the resolution of a global transaction during a recovery operation. Any help would be appreciated.
Thanks,
Matt
Only when all the participants return ok, the transaction will be returned to the database as committed. If the TM cannot reconnect it will stay as in doubt, potentially locking database pages (This generally requires manual cleanup).
Depending on timeout settings, the client application can receive errors. Some db systems like oracle allow to simulate different error conditions. The following link describes that http://docs.oracle.com/cd/B28359_01/server.111/b28310/ds_txnman009.htm#ADMIN12285

Perfect data integrity possible with database transactions that correspond to real world events?

I was talking to a guy who was using an ATM when it crashed (it was running Windows XP, apparently) and took his money.
A transactional database with write-ahead logging can ensure that your database remains in a consistent state, even if the ATM crashes (i.e. you will always know how much money should be in the ATM and in the customer's account). Dispensing cash, however, is not just a DB transaction and is not an instant operation, so should you commit the transaction before or after the cash is dispensed? In both cases, it is possible for either the bank or the customer to lose money if the ATM crashes at the right time.
Are there any perfect (or at least reasonably perfect) solutions to this problem?
One way I can think is if the ATM had the capability to count the amount of money in it. If the ATM committed the transaction first and then dispensed the cash, then upon recovering from a crash, the ATM could immediately dispense any additional money above what it should contain according to the guaranteed consistent database.
But from a hardware standpoint I don't know if that would really be feasible.
What do you think? Are there any other ways to deal with this issue?
If there is an activity outside the database system within a transaction, using "status" column to build a "manual transaction" is a solution for such situation.
for example:
Dispense Cache Status:
0 - Check the account of user
1 - Check passed, dispensing cache
2 - Dispense cache sucessfully
-1 - Updated status after reboot the ATM from crash if the status is 1
-2 - Updated status after reboot the ATM for other erratic situations ...
You may design more status to describe the difficult crash situation.

Are distributed database transactions guaranteed to commit/rollback?

I have application code that inserts a record in a local database and a record in a remote database (via Oracle Database Link). When I commit this distributed transaction is it guaranteed that both the local and remote databases will both commit or both rollback, or is there a chance that the remote one could commit but the local commit would fail (or vice versa)?
I'd be astonished if Oracle does not use the equivalent of the Two-Phase Commit (2PC) protocol, which ensures that either both commit or both rollback.
With 2PC, there is a stage called the pre-commit phase where the master (coordinator) instance records its own decision and tells all participants to get ready to commit (and report their status - must fail, or can commit). The participants also get ready to commit, and (if they can commit) await further instructions from the coordinator after telling the coordinator they are ready to commit. When all the participants have responded, the coordinator records the final decision, and sends that decision to the participants, and acts on its decision. If the master fails after recording the decision but before successfully sending the decision to the participants, the participants can be hung up in a state where they can neither commit nor rollback. There are ways to recover from that. If the coordinator stays down long enough (for example, is taken out of service as a result of catastrophic h/w failure) you can end up with problems; the participants end up doing a heuristic rollback (presumed rollback), typically - but this requires astonishingly bad luck to cause any trouble.
There are alternatives to 2PC; the net result is the same - all commit or all rollback.

distribution transaction lock in oracle database

I have some question around transaction lock in oracle database. What I have found out so far is that:
Cause: The time to wait on a lock in a distributed transaction has been exceeded. This time is specified in the initialization parameter DISTRIBUTED_LOCK_TIMEOUT.
Action: This situation is treated as a deadlock and the statement was rolled back. To set the time-out interval to a longer interval, adjust the initialization parameter DISTRIBUTED_LOCK_TIMEOUT, then shut down and restart the instance.
Some other things that I want to know in more details are things like:
It is mentioned that a lock in 'distributed transaction' happened. So what kind of database operation that can cause this ? Updating a record ? Selecting a record ?
What does 'Distributed' means anyway. I have seen this term coined all over the place, but I can't seem to deduce what it means.
What can we do to reduce instances of such lock ?
A distributed transaction means that you had a transaction that had two different participants. If you are using PL/SQL, that generally implies that there are multiple databases involved. But it may simply indicate that an application is using an external transaction coordinator in its interactions with the database. A J2EE application, for example, might want to create a distributed transaction that covers both issuing SQL statements against a database to move $100 from account A to account B as well as the application server action of creating a JMS message for this transaction that would eventually cause an email notification of the transfer to be sent. In this case, the application wants to ensure that the state of the middle tier matches the state of the back end.
Distributed transactions are not free. They involve potentially quite a bit of additional overhead because, at a minimum, you need to use the two-phase commit protocol to verify that all the components that are part of the distributed transaction are ready to commit and to verify that they all did commit. That involves sending a number of network packets which can be a significant fraction of the time an OLTP transaction is waiting. Distributed transactions also cause administrative issues because you end up with cases where one participant's transaction fails after it indicated it was ready to commit or a transaction coordinator failing while various participants have open transactions.
So the first question would be whether your application actually needs distributed transactions. Sometimes, developers find that they are accidentally requesting distributed transactions when they really aren't necessary. If you're not sure what a distributed transaction is, it's entirely possible that you don't really need them.
There is a guide here that will walk you through the steps to simulate an ORA-02049: timeout: distributed transaction waiting for lock if you want a better understanding of one of its causes: