Backing up and Restoring Oracle XE

At work we use Oracle as our production database and Oracle XE as our development database on our laptops/desktops. I recently received a new laptop and needed to move Oracle XE and all of the data from my old machine to my new machine. After some searching around I found a very simple method.

  1. Install a fresh copy of Oracle XE on the new machine.
  2. On the old machine run the “Backup Database” command which is located in the Windows Start Bar.
  3. Copy the following folders and files from the old machine to the new machine.
    • c:\oraclexe\app\oracle\flash_recovery_area\XE\AUTOBACKUP\*
    • c:\oraclexe\app\oracle\flash_recovery_area\XE\BACKUPSET\*
    • c:\oraclexe\app\oracle\product\10.2.0\server\database\SPFILE2INIT.ORA
  4. On the new machine run the “Restore Database” command which is located in the Windows Start Bar.

That is all there is to it. You should now have all of your schemas and data on your new machine.



Cross Browser Testing

If you have done web development for more than 5 minutes you probably have run into browser compatibility issues. I have not only run into CSS issues but also jQuery issues where the code wasn’t functioning correctly on some browsers. Making sure that your site renders and runs correctly in all of the major browsers is very important. This is especially true if it is a public site where you can’t control browser types and versions.

So how do you cross browser test without installing all of the browsers on your computer?

Spoon Browser SandboxIn comes the Spoon Browser Sandbox. The Spoon Browser Sandbox offers 11 different Web browser builds, including IE 6, 7, and 8, Firefox 2, 3, and 3.5, Safari 3 and 4, Opera 9 and 10, as well as Google Chrome. The only thing you have to install is their plug-in. Once you have the plug-in installed you can run any of these browsers on your computer just as if they were installed themselves. The sandbox browsers are seemingly fully functional, and they feel just as you might expect them to. I have even installed Firebug on one of the sandbox browsers to troubleshoot JavaScript issues.

I have looked around the web for other cross browsing tools but haven’t found anything nearly as cool and functional as this. Give it a try and let me know what you think.



JSF valueChangeListener fired before UpdateModel phase

The other day I was trying to use a JSF valueChangeListener to compare 2 passwords fields for equality.

The bean code.

1
2
3
4
5
6
7
8
9
10
@In
private Map<String, UIComponent> uiComponent;

//Change listener to make sure passwords match
public void verifyPasswordMatches(ValueChangeEvent e) {
  verifyPassword = (String) e.getNewValue();
  UIComponent password = uiComponent.getSubmittedValue("registration:passwordField:password");
 
  //Compare the 2 fields.
}

The 2 fields in the view.

1
2
<h:inputSecret value="#{register.password} id="password" />
<h:inputSecret value="#{register.verifyPassword} valueChangeListener="{register.verifyPasswordMatches}" id="verifyPassword"/>

No matter what I tried I couldn’t get the value from the password field. After scratching my head for a while I finally figured out why. It is because the valueChangeListener is fired before the UpdateModel phase. This means the model is still empty which explains why the password field was blank. The only field that has a value is the field that has the valueChangeListener.

The morale of the story…remember the JSF life cycle.



Next

Prev