How to deal Large Dataset using Eloquent? - database

In my table there are more than 5.600.000 records. When I try to get records using PAGINATE(15), after a very long processing server response Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, contact#example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.". Please help, Thanks in Advance.

It's probably caused by php.ini configuration.
You can check your error logs for more info (php error logs or laravel /storage/logs).
It can be memory_limit, max_execution_time or some other setting in php.ini

Its the problem with paginate(). paginate() retrieves all the rows in a table and counts the total rows to determine the total no of pages required. Since you have 5600,000 rows in the table, it is taking a long time to retrieve the results which eventually might be reaching max_execution_time or memory_limit.
I suggest the best way is to use simplePaginate()

Related

SQL ERROR 5172 : PAGEAUDIT PROPERTY IS INCORRECT

I am try to execute below query through ADO.NET i.e. ExecuteNoQuery from Windows Application:
CREATE DATABASE TESTDATABASE ON (NAME=TESTDATABASE, FILENAME='C:\Test\TEST.mdf', SIZE=4MB, FILEGROWTH=4MB) COLLATE Latin1_General_CS_AS;
In Production, most of the times it works, but rarely fails with below error and we are not able to reproduce:
ERROR: "The header for file 'C:\Test\TEST.mdf' is not a valid database
file header. The PageAudit property is incorrect"
Any insights on this issue are highly appreciated.
Checked information about 5172 from below urls here and here.
Above all talks about fixing the solution.
Is there any way we can prevent this error?
Is 5172 can be caused due to RACE Conditions?

DNN Persona bar, error 500 on API/personaBar/localization/gettable?culture=en-US

After logging in DNN (v. 09.01.01 (129)) thru the /login interface,
The site makes space for the DNN bar, but the DNN bar does not actually appear.
After which in console we see this particular error
/API/personaBar/localization/gettable?culture=en-US:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
We have tried all the suggestions in DNN's forums here,
But none seem to work (deleting the LocalResources.en-US file, checking Permissions..)
How ca nwe diagnose the actual issue, and how do we restore the persona Bar?
It's hard to say, but here's some options :
If you do a custom module, make sure it not overwrite Newtonsoft.json.dll and System.web.http.dll, try overwrite the library with your backup.
Make sure there's no virtual directory under your website.
Try upgrade it to latest DNN.
Two ways to try to get additional details about the error. First try recreating it then connect to your SQL server to run a query or two.
You can try to query the EventLog table to try to find the specific error. From that table row, you'll need to grab the ExceptionHash value and then query the Exceptions table to try to get details.
select top 5 * from eventlog
where exceptionhash is not null
order by logcreatedate desc
select * from exceptions where exceptionhash = '###'
(replace ### with the hash found in the first results)
From the exceptions table you'll want to look at the Message and StackTrace columns for any details that might point you in the direction of what the actual issue is.
You'll also likely find that upgrading to the most recent release may fix your problems.

What is the Oracle error code (ORA-) for a Query Timeout?

I need to know whats the oracle QUERY timeout error code.
I know the code ORA-12170, but this code is an TNS connect timeout. I need the Query timeout.
I looked in many places and not find the answer.
ORA-01013 - user requested cancel of current operation
This is the message and code which you will get when the timeout happens.
I'm not agree with you. When you hit an ORA-01013, it's because you have no more temp space to execute your query.
ORA-01555: snapshot too old is more appropriate. It's caused by Oracle read consistency mechanism.

SSAS Cube Errors, Not Deploying

I'm getting two errors which are very vague.
Internal error: The operation terminated unsuccessfully.
Server: The operation has been cancelled.
This occurs when I try to deploy the cube to the server.
Does anyone know how to fix this error?
Thanks,
Ethan
EDIT:
I just processed each dimension individually and all but one processed successfully.
I also have this one warning message that is suspicious
Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'dbo_DimPractice', Column: 'Phone', Value: '(111) 111-1111 ‎'. The attribute is 'Phone'.
So The problem was that there were duplicate phone numbers with different phone numbers. I fixed this by changing the key on the attribute column to include the other attributes.
After fixing that, I had the same warning come up for my time dimension and I did the same thing for it, and then it deployed successfully.
Re-apply the service account if it was working earlier & restart the service of SSAS it will starts working.

how to treat/handle an exception and display a custom error message on Reporting Services

Fellow developers,
I'm creating a report to be seen directly by the clients, so I need to ensure maximum user-friendliness. When the user types an invalid date string the report throws a rsReportParameterTypeMismatch and displays an error messages like this:
An error occurred during local reoprt processing
Query Execution Failed for data set 'myDataSet'
I want to replace this cryptic (for the final user) message for a more friendly custom message. How or where can I write them? How do I intercept the exception? I don't need anything too complex, just changing the words, perhaps colors and sizes would suffice.
I thank thee in advance for thy willingness to help.
take a look at Custom error pages in Reporting Services 2008

Resources