How can I avoid getting the database in oracle?

I have a php application that connects to a database that has only two tables: usersand folders. When you enter the application and press the button, foldersa huge number of records are inserted in the table . The process takes about 15 minutes. During this time, the entire application gets stuck. In my application header, I have something like

select * from users where id = {$_SESSION['user_id']}

but until these tens of thousands of records are inserted into the table folders, the second query simply will not be executed. After I wait 15 minutes and the import is complete, I can access any page I want. How can I fix this problem?

A very important thing that I initially forgot to mention (my apologies for this) is the oracle database. I tested it before for MySql (just for curiosity) and it works without problems, but for the oracle, it seems to be the problem. The connection is made using OCI8.

+4
source share
3 answers

A 15-minute population should occur in the background task, then it is trivial to find out if the user exists. If you don’t show any message to the user.

For example, the virtualization function githubs, you see a scanned workbook until the background task is completed.

This can be done by having a third table with a user ID and a processed column. The background task is looking for processed = 0 and processing.

= 1 , = 0 .

procssing , DB

+3

, longprocess.php header(), shortprocess.php. , longprocess.php 15 , shortprocess.php .

longprocess.php

<?php 
header('Location: shortprocess.php');
//time taking sql query here
exit;
?>

P.S. php , .

+2

, : , , PHP. "session_start()" session_write_close(). , session_start() 15 . , session_write_close ( , script), , script, PHP-, .

0

Source: https://habr.com/ru/post/1610104/


All Articles