Our PB windows application was developed in PB version 8 and it has been migrated to PB 2019 R3. The PB 8 build it not crashing but when it was migrated to PB2019 R3, we encountered crashing issue during its runtime. I did a debugging and found out that the application is crashing inside the window function, of_filter( ). By the way, the back end is Oracle 12g.
Here is the code under the window object, function of_filter:
/////////////////////////////////////////////////////////////////////////////
// Object : w_job_list
// Function : of_filter
//
// Override: No
//
// Arguments: None
//
// Returns : (None)
//
// Description: Filters the job list data window to match what the user
// has selected as a filter option.
//
// ///////////////////////////////////////////////////////////////////////////
String ls_filter
integer li_rc
Long ll_primary_rowcount, ll_filter_rowcount
Long ll_row
long ll_rows
long ll_found
decimal ld_job_id
string ls_sort
string ls_server_date_time
long ll_job_search
dw_list.SetRedraw( FALSE )
iuo_parent.SetRedraw( FALSE)
ib_filter_in_progress = true
IF iuo_parent.dw_job_search.Rowcount() > 0 THEN
ld_job_id = iuo_parent.dw_job_search.object.job_id[iuo_parent.dw_job_search.Getrow()]
End If
/* rbl 4 April 2023 VSDEV-744
* For some reason, this Filter action doesnt work with an empty primary buffer,
* nor do subsequent filters if I skip over this one.
* Move all rows from the Filter buffer to the Primary buffer before filtering. */
/* rbl 23 June 2023 VSDEV-801
* Now it sometimes doesn't work at all, but sometimes it does.
* Move all rows from filtered to primary regardless of counts. */
ll_primary_rowcount = iuo_parent.dw_job_search.RowCount()
ll_filter_rowcount = iuo_parent.dw_job_search.FilteredCount()
li_rc = iuo_parent.dw_job_search.RowsMove &
(1, ll_filter_rowcount, Filter!, &
iuo_parent.dw_job_search, 1, Primary!)
//IF ((ll_primary_rowcount = 0) AND (ll_filter_rowcount > 0)) THEN
//END IF
iuo_parent.dw_job_search.SetFilter( '' )
iuo_parent.dw_job_search.Filter()
ll_rows = iuo_parent.dw_job_search.RowCount()
CHOOSE CASE as_status
CASE 'W'
ls_server_date_time = string(sqlca.of_get_server_datetime(),"YYYY-MM-DD")
ls_sort = 'Long(bill_customer_no) A, enter_date A, prefix_sort A'
ls_filter = "( isnull(ship_date) and status not in ( 'CANCEL' , 'STKCANCL') ) "+&
"or (date(ship_date) = "+ls_server_date_time+") "+&
"or (status in ( 'CANCEL', 'STKCANCL' ) "+&
" and date(cancel_date) = "+ls_server_date_time+")"
dw_list.Object.date_holder_t.text = 'Ship Date'
FOR ll_row = 1 TO ll_rows
dw_list.Object.date_holder[ll_row] = iuo_parent.dw_job_search.Object.ship_date[ll_row]
NEXT
CASE 'S'
ls_sort = 'Long(bill_customer_no) A, ship_date A, prefix_sort A'
dw_list.Object.date_holder_t.text = 'Ship Date'
FOR ll_row = 1 TO ll_rows
dw_list.Object.date_holder[ll_row] = iuo_parent.dw_job_search.Object.ship_date[ll_row]
NEXT
ls_filter = 'Not IsNull( ship_date )'
CASE 'C'
ls_sort = 'Long(bill_customer_no) A, cancel_date A, prefix_sort A'
dw_list.Object.date_holder_t.text = 'Cancel Date'
FOR ll_row = 1 TO ll_rows
dw_list.Object.date_holder[ll_row] = iuo_parent.dw_job_search.Object.cancel_date[ll_row]
NEXT
ls_filter = 'Not IsNull( cancel_date )'
CASE 'A'
ls_sort = 'Long(bill_customer_no) A, enter_date A, prefix_sort A'
ls_filter = ''
dw_list.Object.date_holder_t.text = 'Ship Date'
FOR ll_row = 1 TO ll_rows
dw_list.Object.date_holder[ll_row] = iuo_parent.dw_job_search.Object.ship_date[ll_row]
NEXT
END CHOOSE
li_rc = iuo_parent.dw_job_search.SetFilter( ls_filter )
If IsNull(li_rc) or li_rc < 1 Then
error.of_application_error(this,"of_filter",&
"Error encountered when setting filter.~r~n"+&
" Return code = "+f_null_check(li_rc)+"~r~n"+&
" Filter command = "+f_null_check(ls_filter))
End IF
li_rc = iuo_parent.dw_job_search.Filter()
If IsNull(li_rc) or li_rc < 1 Then
error.of_application_error(this,"of_filter",&
"Error encountered when filtering job list.~r~n"+&
" Return code = "+f_null_check(li_rc)+"~r~n"+&
" Filter command = "+f_null_check(ls_filter))
End IF
li_rc = iuo_parent.dw_job_search.SetSort( ls_sort )
If IsNull(li_rc) or li_rc < 1 Then
error.of_application_error(this,"of_filter",&
"Error encountered when setting sort criteria.~r~n"+&
" Return code = "+f_null_check(li_rc)+"~r~n"+&
" Sort command = "+f_null_check(ls_sort))
End IF
li_rc = iuo_parent.dw_job_search.Sort()
If IsNull(li_rc) or li_rc < 1 Then
error.of_application_error(this,"of_filter",&
"Error encountered when sorting job list.~r~n"+&
" Return code = "+f_null_check(li_rc)+"~r~n"+&
" Sort command = "+f_null_check(ls_sort))
End IF
ib_filter_in_progress = false
// Put the current row back to the same job id if the job id exists
// in the current list.
ll_found = 0
IF not ISNULL(ld_job_id) and ld_job_id <> 0 THEN
ll_found=iuo_parent.dw_job_search.Find("job_id = " + String(ld_job_id),1,iuo_parent.dw_job_search.RowCount())
End If
If ll_found = 0 or ll_found <> iuo_parent.dw_job_search.getrow() or ll_found > 0 Then
iuo_parent.dw_job_search.ScrollTorow(max(1,ll_found))
End If
dw_list.SetRedraw( TRUE )
iuo_parent.SetRedraw( TRUE)
this.Event vs_set_environment()
Here is an Event Log description of the crash:
Faulting application name: customer.exe, version: 5.0.0.0, time stamp: 0x6100e416
Faulting module name: orageneric12.dll, version: 12.2.0.1, time stamp: 0x58a2624c
Exception code: 0xc0000005
Fault offset: 0x01136007
Faulting process ID: 0x4578
Faulting application start time: 0x01d9c4e68bb84a68
Faulting application path: C:\SourceTree\Build Release\V05.22.00-VSDEV819\customer\customer.exe
Faulting module path: C:\Oracle\Win.32\12.2_InstantClient\bin\orageneric12.dll
Report ID: a16e707a-0f52-40d3-8fb2-e868019a4cd3
Faulting package full name:
Faulting package-relative application ID:
Anyone else experience this?
Regards,
Alex
The return value of iuo_parent.dw_job_search.SetFilter( ' ' ) is 1.
iuo_parent.dw_job_search.dataobject = "d_job_search"
Regards,
Alex
Have you tried using the ORA OCI driver instead of instant client?
Just hoping to give you any ideas ....