I have a bean dedicated to export a CSV and due to the big amount of data it takes around 15 minutes o more and I get a timeout.
In order to solve this I thought about adding some kind of configuration only for this bean, as I mustn't increase Glassfish timeouts. So in my local machine I changed Glassfish timeout configurations to make some tests and reduce those 15 minutes (Request Timeout from Network Listeners and IDLE timeout from Thread Pools) and, by adding just a @Transactional annotation it worked, but when I used a preproduction machine it didn't.
Both are Glassfish 4.1.1, but in preproduction I also use Nginx. But trying through the 8181 port (HTTPS, which my Nginx doesn't control) it didn't work neither.
So I've been trying different solutions:
- @Transactional (cause transactions timeout is 0 in Glassfish)
- Use a EJB
- @StatefulTimeout
- @TransactionManagement(TransactionManagementType.CONTAINER) and @TransactionAttribute(TransactionAttributeType.REQUIRED)
None of this worked in preproduction. Can someone guide me a bit?
Edit: This is my configuration of Nginx.
server {
listen 80;
client_max_body_size 900M;
server_name *my config*;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
proxy_ignore_client_abort off;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:8080;
}
}
The thing is even though setting timeouts in Glassfish and reducing it to 1 minute, in preproducction I can't avoid that timeout and the connection closes after that minute.

所有评论(0)