Installing Oracle VirtualBox and configuring a virtual machine

This video is the first of a complete videotutorial course about PostgreSQL – usage and management – that is under construction but it will be released in a couple of weeks. The course is focused on teach you how to install PostgreSQL on Windows or Linux, configuring it and tuning it, learn the basics of DML and DDL, learn programming language PL/pgSQL, triggers, backup and restore, using command line tools like psql and so on. This first video isn’t about PostgreSQL, it’s about installing and configuring VirtualBox. The idea is to install PostgreSQL on a virtual machine to simulate a remote database server, or to teach you how to install it on Linux if your computer OS is Linux.

Set Conversation timeout on CDI Beans

Conversation scope is a nice feature when you want to save values over request on different pages as long as you still interact with the same bean. Basically is a session scope where you have to start the conversation explicitly with a default timeout (unless you finish the conversation manually).

Default CDI Conversation scope timeout is 30 minutes. This means that, if you stop interacting with the GUI and there’s no requests to server side components, server saves conversation data during 30 minutes until it destroys it. That’s a lot of time.

You can define conversation timeout by using setTimeout() method of Conversation object by defining time in milliseconds. In the next example the timeout is set to 20 seconds. You can test timeout by pressing the button a couple of times to increase counter, then wait 20 seconds without doing anything and then pressing again a couple of times.

Continue reading