一组相互关联的操作,必须全部成功才能使其中任何一个成功。任何操作失败都会导致事务中所有操作的回滚。
我正在收集有关flush()方法的信息,但我不太清楚何时使用它以及如何正确使用它。从我读到的内容来看,我的理解是坚持的内容
从同一类的另一个非事务性方法调用事务性方法时,什么可能会导致潜在的运行时问题?
这是一个理解 Spring 中的事务的概念问题。 该代码可能导致什么潜在的运行时问题?我知道当我们尝试运行它时,事务上下文将会丢失......
我遇到一个问题,即捆绑产品的子选项/产品在交易电子邮件中未正确排序。 在这种情况下,排序顺序很重要,因为产品型号处于...
当我尝试更新 MySQL 表行时,出现锁等待超时异常。我对表的其他行没有这个问题。我重新启动了应用程序,但锁还没有被释放...
我花了一整天的时间来解决这个问题,但我找不到。 错误 HTTP 状态 500 - 类型异常报告 信息 描述 服务器遇到一个 int...
存储库方法getReferenceById是否真的延迟加载以及如何测试它是否抛出异常?
我了解 getReferenceById 存储库方法是延迟加载实体。 所以我有以下服务: @服务 公共类 PostService { 公共帖子 getReferenceById(长 id) { ...
我想删除未使用的表。我列出了空表,以确保表在 1 周内不会进行插入和删除(使用临时表等)。 有没有办法检查桌子是否不存在
我有一个我不明白的奇怪行为,因为它的行为似乎不像我读过的文档中那样,我正在使用 springboot 3.2.4 我有一个服务类,其 methodA 标记为
我需要后台工作人员的 DoWork 帮助。我收到消息 System.InvalidOperationException:“未为对象实例定义对象引用”,但仅在某些情况下...
我有200万条数据需要插入到postgresql中。但它却发挥了低效。我可以通过将大事务分割成更小的事务来实现高性能插入器吗...
Typeorm、Node.js 中的 queryRunner.commitTransaction() 之后更新会有任何影响
Node.js / Nest.js /Typeorm /postgresql 我的代码是 我有餐桌农场 |编号 |中心点类型 GeoJson |点类型 GeoPoints| 可以保存到数据库,之前有其他更新方式吗
Eip838ExecutionError:执行已恢复:可拥有:调用者不是所有者
发送交易,发生错误。 Eip838ExecutionError:执行已恢复:可拥有:调用者不是所有者 内部错误:[Eip838ExecutionError:执行已恢复:可拥有:调用者不是所有者...
我正在使用express.js 创建一个项目,我想对使用sequelze.js 和PostgreSQL 执行的一个或多个数据库查询进行分组以创建事务。我已经创建了托管交易...
如何记录 Spring JDBC DataSourceTransactionManager 的事务开始、提交和回滚?
我需要检查Spring JDBC的事务命令。 如何使用 log4j 记录从 Spring JDBC DataSourceTransactionManager 自动调用的事务开始、回滚和提交?
我目前正在使用 transactWrite 将数据插入 dynamoDB 数据库。只允许一批小块(比方说 100 个)进行事务,但我想以 All-or-
我有一个用@Transactional注释的方法,在这个方法中,我调用了另一个没有用@Transactional注释的方法。我试图理解其中的交易行为
PyMongo 事务错误:事务编号仅允许在副本集成员或 mongos 上
当我使用pymongo 3.7事务功能连接到mongo服务器4.0时,出现此错误“事务编号仅允许在副本集成员或mongos上”,并且我找不到任何...
我正在尝试创建一个 solana 机器人,它具有使用 raydium 购买 $MAGA 的限价订单。但是,每次我运行代码时,事务都不会完成。 # Returns the swap_transaction to be manipulated in sendTransaction() async def create_transaction(quote: dict, input_token_mint, output_token_mint) -> dict: log_transaction.info(f"""Soltrade is creating transaction for the following quote: {quote}""") if 'error' in quote: log_transaction.error(f"Error in quote: {quote['error']}") raise Exception(f"Error in quote: {quote['error']}") pool_id = get_pool_id(input_token_mint) #pool_id = "9XsGAA3xHC6gqRgThRrcaUPU6jzerZacWgfyMb17579t" # Parameters used for the Raydium POST request parameters = { "quoteResponse": quote, "userPublicKey": str(configs['public_address']), "wrapUnwrapSOL": True, "computeUnitPriceMicroLamports": 20 * 3_000_000 # fee of roughly $.4 :shrug: } #9XsGAA3xHC6gqRgThRrcaUPU6jzerZacWgfyMb17579t # Returns the JSON parsed response of Jupiter async with httpx.AsyncClient() as client: response = await client.post(f"https://api.raydium.io/v2/swap?poolId={pool_id}", json=parameters) exchange_data = response.json() pprint(f"TRANSACTION CREATE:\n{exchange_data}") return exchange_data async def perform_swap(sent_amount: float, price_limit, sent_token_mint: str, mode : str): global position log_general.info("Soltrade is taking a limit position.") #TODO: fetch the current price and create a limit order current_price = get_price(sent_token_mint) base_token = await get_token_decimals(sent_token_mint) quote = trans = opts = txid = tx_error = None is_tx_successful = False for i in range(0,3): if not is_tx_successful: try: if (mode == "buy") or (mode == "sell"): quote = await create_exchange(sent_amount, sent_token_mint, mode) trans = await create_transaction(quote, sent_token_mint, SOL_MINT_ADDRESS) print(f"TRANS:\n{trans}") opts = TxOpts(skip_preflight=False, preflight_commitment="confirmed", last_valid_block_height=find_last_valid_block_height()) txid = send_transaction(trans["swapTransaction"], opts) for i in range(3): await asyncio.sleep(35) tx_error = find_transaction_error(txid) if not tx_error: is_tx_successful = True break else: log_general.info(f"Price hasn't reached {price_limit}. Waiting for the next opportunity.") await asyncio.sleep(60) continue #current_price = get_price(sent_token_mint) except Exception as e: if RPCException: print(traceback.format_exc()) log_general.warning(f"Soltrade failed to complete transaction {i}. Retrying.") continue else: raise for i in range(0, 3): try: await asyncio.sleep(35) tx_error = find_transaction_error(txid) if not tx_error: is_tx_successful = True break except TypeError as e: print(traceback.format_exc()) log_general.warning("Soltrade failed to verify the existence of the transaction. Retrying.") continue else: break 2024-05-27 14:19:22 Soltrade has detected a buy signal. 2024-05-27 14:19:22 Soltrade is taking a limit position. Response: SOL 2024-05-27 14:19:22 Soltrade is creating exchange for 12.103126943600001 dollars in ('', '') Pool ID: 8sLbNZoA1cfnvMJLPfp98ZLAnFSYCFApfJKMbiXNLwxj ('EXCHANGE CREATED:\n' "{'id': '03c2fd251bb64b3a85a3207deae7b010', 'success': False}") 2024-05-27 14:19:23 Soltrade is creating transaction for the following quote: {'id': '03c2fd251bb64b3a85a3207deae7b010', 'success': False} ('TRANSACTION CREATE:\n' "{'id': '64218b3c90b943d0a1069e43248f406f', 'success': False}") TRANS: {'id': '64218b3c90b943d0a1069e43248f406f', 'success': False} Traceback (most recent call last): File "/Users/dekahalane/soltrade-1/soltrade/transactions.py", line 204, in perform_swap txid = send_transaction(trans["swapTransaction"], opts) KeyError: 'swapTransaction' 2024-05-27 14:19:24 Soltrade failed to complete transaction 0. Retrying. 我尝试过调试,增加滑点和费用。我研究了任何 Solana python 文档,但找不到任何文档。我认为问题可能是链接错误。 我碰巧通过切换到 Jupiter api 并使用这些链接来解决这个问题: 这个在create_exchange(): https://quote-api.jup.ag/v6/quote?inputMint={input_token_mint}&outputMint={output_token_mint}&amount={int(amount_in)}&slippageBps={config().slippage} 这个在create_transaction(): https://quote-api.jup.ag/v6/swap
我正在寻找一种方法来查明当前会话中是否存在未提交的 INSERT、UPDATE 或 DELETE 语句。一种方法是使用当前 sid 检查 v$lock,但这需要读取...
我正在尝试在子事务中应用更改并释放更改的表,但尚未在主事务中。 就像这样: 主要事务: 进行交易: // 做东西 子交易: ...