TRANSACTION MODE LOCK FLAG PROCESS FLAG TRANSACTION STATUS i

本文深入解析Oracle应用中交易管理的内部工作原理,包括在线、并发和后台处理模式,以及锁定和进程标志的作用。通过理解不同交易状态的意义,读者将能更有效地管理和解决交易处理中的常见问题。

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.youkuaiyun.com/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

TRANSACTION_MODE,LOCK_FLAG,PROCESS_FLAG in MTI(MTL_TRANSACTIONS_INTERFACE) or MMTT(MTL_MATERIAL_TRANSACTIONS_TEMP)

* For transactions stuck in MMTT
update mtl_material_transactions_temp
set process_flag = 'Y',
lock_flag = NULL ,
Transaction_mode = 3  ,
Error_code = NULL ,
Error_explanation = NULL
where transaction_header_id = &transaction_header_id
and error_code is not NULL;

 
*For transactions stuck in MTI
update mtl_transactions_interface
set process_flag =  1,
lock_flag = NULL ,
Transaction_mode = 3 ,
Error_code = NULL ,
Error_explanation = NULL
where transaction_header_id = &transaction_header_id
and error_code is not NULL;


TRANSACTION_MODEMeaningDescription    
NULL or 1Online ProcessingOnline processing is used by the Oracle Applications to immediately process records. This does not require that a concurrent program be run. The Transaction Manager does not process transactions marked for online processing. 
2Concurrent ProcessingTransactions marked as concurrent transaction mode are processed by a dedicated transaction worker to explicitly process a set of transactions. The Transaction Manager does not process transactions marked for concurrent processing. 
3Background ProcessingInterface transactions marked for Background processing will be picked up by the transaction manager polling process and assigned to a transaction worker. These transactions will not be processed unless the transaction manager is running. 
8Internal Processing (Not visible in the pending transactions form)Transaction mode 8 is not a mode normally visible to the user as it is used for internal processing.  Transactions with this mode are not visible in the Pending transactions form. Transaction_mode of 8 is used internally to identify if records came from the interface table to the pending table or came directly into the pending table. 
 
LOCK_FLAGMeaningDescription 
1LockedFlag indicating whether the transaction is locked by the Transaction Manager or Workers.this prevents two different Workers from processing the same transaction; You should always specify ’2’ 
2 or NULL or 'N'NOT Locked 
 
PROCESS_FLAGMeaningDescription 
1 or YReadyTransaction is ready to be processed by the Transaction Manager or Worker (’1’ for ready, ’2’ for not ready); if the transaction fails for some reason, the Transaction Worker sets the value of PROCESS_FLAG to ’3’. 
2 or NULLNOT Ready 
EError     
 


       
TRANSACTION_STATUSMeaning
1 or NullDefault  behavior
2Save  only
3Ready  to process
For Move Order case, As soon as a move order is allocated, a record is inserted into the MTL_MATERIAL_TRANSACTIONS_TEMP table.  The column TRANSACTION_STATUS keeps track of the progress of the move order.

These are the current values for TRANSACTION_STATUS:

STATUS 1 = PENDING
STATUS 2 = ALLOCATED
STATUS 3 = TRANSACTED / This is where went into internal processing and waiting for transaction manager to run if transaction_mode is 3 / background.


转载请注明出处:http://blog.youkuaiyun.com/pan_tian/article/details/7899178

===EOF===

           

给我老师的人工智能教程打call!http://blog.youkuaiyun.com/jiangjunshow
这里写图片描述
/** * @brief Transmit an amount of data in blocking mode. * @param hspi pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @param pData pointer to data buffer * @param Size amount of data to be sent * @param Timeout Timeout duration * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout) { uint32_t tickstart; HAL_StatusTypeDef errorcode = HAL_OK; uint16_t initial_TxXferCount; /* Check Direction parameter */ assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction)); /* Process Locked */ __HAL_LOCK(hspi); /* Init tickstart for timeout management*/ tickstart = HAL_GetTick(); initial_TxXferCount = Size; if (hspi->State != HAL_SPI_STATE_READY) { errorcode = HAL_BUSY; goto error; } if ((pData == NULL) || (Size == 0U)) { errorcode = HAL_ERROR; goto error; } /* Set the transaction information */ hspi->State = HAL_SPI_STATE_BUSY_TX; hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pTxBuffPtr = (uint8_t *)pData; hspi->TxXferSize = Size; hspi->TxXferCount = Size; /*Init field not used in handle to zero */ hspi->pRxBuffPtr = (uint8_t *)NULL; hspi->RxXferSize = 0U; hspi->RxXferCount = 0U; hspi->TxISR = NULL; hspi->RxISR = NULL; /* Configure communication direction : 1Line */ if (hspi->Init.Direction == SPI_DIRECTION_1LINE) { /* Disable SPI Peripheral before set 1Line direction (BIDIOE bit) */ __HAL_SPI_DISABLE(hspi); SPI_1LINE_TX(hspi); } #if (USE_SPI_CRC != 0U) /* Reset CRC Calculation */ if (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SPI_RESET_CRC(hspi); } #endif /* USE_SPI_CRC */ /* Check if the SPI is already enabled */ if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); } /* Transmit data in 16 Bit mode */ if (hspi->Init.DataSize == SPI_DATASIZE_16BIT) { if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U)) { hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint16_t); hspi->TxXferCount--; } /* Transmit data in 16 Bit mode */ while (hspi->TxXferCount > 0U) { /* Wait until TXE flag is set to send data */ if (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) { hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint16_t); hspi->TxXferCount--; } else { /* Timeout management */ if ((((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY)) || (Timeout == 0U)) { errorcode = HAL_TIMEOUT; goto error; } } } } /* Transmit data in 8 Bit mode */ else { if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U)) { *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint8_t); hspi->TxXferCount--; } while (hspi->TxXferCount > 0U) { /* Wait until TXE flag is set to send data */ if (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) { *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr); hspi->pTxBuffPtr += sizeof(uint8_t); hspi->TxXferCount--; } else { /* Timeout management */ if ((((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY)) || (Timeout == 0U)) { errorcode = HAL_TIMEOUT; goto error; } } } } #if (USE_SPI_CRC != 0U) /* Enable CRC Transmission */ if (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT); } #endif /* USE_SPI_CRC */ /* Check the end of the transaction */ if (SPI_EndRxTxTransaction(hspi, Timeout, tickstart) != HAL_OK) { hspi->ErrorCode = HAL_SPI_ERROR_FLAG; } /* Clear overrun flag in 2 Lines communication mode because received is not read */ if (hspi->Init.Direction == SPI_DIRECTION_2LINES) { __HAL_SPI_CLEAR_OVRFLAG(hspi); } if (hspi->ErrorCode != HAL_SPI_ERROR_NONE) { errorcode = HAL_ERROR; } error: hspi->State = HAL_SPI_STATE_READY; /* Process Unlocked */ __HAL_UNLOCK(hspi); return errorcode; }怎么将这段代码改写成标准库函数,同时我只需要其中8位数据传输的功能
06-17
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值