最近乙個專案mtl_system_items_b表有70,000,000條記錄。 用api inv_item_grp.update_item失效起來巨慢,平均2分鐘乙個物料。
為此看了看oracle驗證的東西,想直接把他驗證的事務處理處理完畢後直接更新表或者更改標準api,去掉更新驗證的東西,讓失效能很快的達到目的。
通過研究,在處理完待定事物處理之後,以下是2個快速失效方案:
1. 直接更新mtl_system_items_b, 確定可行率:80% ,需更新11個字段, 效率:最快捷
2. 更改invupd2b.update_validations,在begin後新增** return 0;, 確定可行率:99%, 效率: 較為快捷
詳細的研究過程就不發了,複製到csdn超級困難。
發一下oracle對於失效檢測的待定事務處理(版本r12.1.3):
--前台後台都判斷,參見
inv_attribute_control_pvt.transactable_uncheck
select count(1)
into l_org_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and pickable_flag = 'y'
--bug 4643978 - perf fix
and inv_inte***ced_flag in ('n', 'p')
--and source_code = 'oe'
and released_status <> 'd'
and organization_id = p_org_id
and rownum = 1;
select count(1)
into l_org_count
from oe_order_lines_all
where source_type_code = 'external'
and open_flag = 'y'
and nvl(shipped_quantity, 0) = 0
and item_type_code in ('model', 'standard', 'option')
and flow_status_code = 'awaiting_receipt'
and inventory_item_id = p_item_id
and ship_from_org_id = p_org_id
and rownum = 1;
select count(1)
into l_org_count
from oe_order_lines_all l
where booked_flag = 'y'
and nvl(shipped_quantity, 0) = 0
and inventory_item_id = p_item_id
and open_flag = 'y'
and ship_from_org_id = p_org_id
and exists (select 1
from mtl_transactions_inte***ce
where trx_source_line_id = l.line_id
and transaction_source_type_id in (2, 8)
and source_code = 'order entry')
and rownum = 1;
select count(1)
into l_org_count
from mtl_supply
where item_id = p_item_id
and to_organization_id = p_org_id
and rownum = 1;
--僅僅前台,參見
invidit3.table_queries
mtl_onhand_quantities_detail
mtl_material_transactions_temp
mtl_demand
--前後臺都檢查,參見
inv_attribute_control_pvt.check_pending_adjustments
select count(1)
into l_org_count
from mtl_cycle_count_entries
where inventory_item_id = p_item_id
and organization_id = p_org_id
and/*entry_status_code = 2 and*/
entry_status_code in (1, 2, 3)
and rownum = 1;
if (l_org_count <> 1) then
select count(1)
into l_org_count
from mtl_physical_adjustments
where inventory_item_id = p_item_id
and organization_id = p_org_id
and adjustment_quantity <> 0
and rownum = 1;
end if;
--invupd2b.update_validations
的5171
,失效也檢查這個
select 'y'
into l_vmiorconsign_flag
po_asl_attributes paa,
po_asl_status_rules pasr
where pasl.item_id = p_item_id
and pasl.using_organization_id in (-1, p_organization_id)
and pasl.asl_id = paa.asl_id
and pasr.business_rule = '2_sourcing'
and pasr.allow_action_flag = 'y'
and pasr.status_id = pasl.asl_status_id
and (disable_flag is null or disable_flag = 'n')
and paa.using_organization_id =
(select max(paa2.using_organization_id)
from po_asl_attributes paa2
where paa2.asl_id = pasl.asl_id
and paa2.using_organization_id in (-1, p_organization_id))
and (paa.consigned_from_supplier_flag = 'y' or paa.enable_vmi_flag ='y')
and rownum = 1;
bom_item_type 不能等於 5
spring事務失效的幾種場景
不廢話 以 mysql 為例,其 myisam 引擎是不支援事務操作的,innodb 才是支援事務的引擎,一般要支援事務都會使用 innodb。根據 mysql 的官方文件 mysql 的官方文件 從 mysql 5.5.5 開始的預設儲存引擎是 innodb,之前預設的都是 myisam,所以這點...
Spring boot事務失效的幾種情況
這幾天在寫專案的時候遇到了spring boot中事務失效的情況,這裡做一下記錄,後面遇到了其他情況再繼續更新。使用乙個沒有事務的方法呼叫乙個有事務的方法,失敗後不會進行回滾 transactional public intupdate admin admin public intinvokeupd...
關於事務巢狀失效的問題
舉例 兩個均加了事務註解的方法a和b,在a方法中呼叫b方法,會導致b的事務不起作用,因為加了事務註解的方法,並不是本身在執行,而是 類在執行,而在a方法中呼叫b方法的時候,預設的是this.b 代表並沒有使用 類來執行,所以不會享受 的服務。也就是不起作用的原因。解決方法 1.獲取當前service...