Jun27
If you have ever run into trouble while removing contents from large tables (because of foreign keys, relations, their huge size, or whatsoever), this is the ultimate solution: TRUNCATE.
truncate table audit cascade;
In my case, this resulted in truncation of all tables (since every table has a reference to the audit table). If you wish to perform the truncation only when there are no references at all, use the restrict keyword (or none at all, since it is the default):
truncate table audit restrict;
In case you are too lazy to read the documentation linked above, here is the most interesting part:
TRUNCATE quickly removes all rows from a set of tables. It has the same effect as an unqualified DELETE on each table, but since it does not actually scan the tables it is faster. Furthermore, it reclaims disk space immediately, rather than requiring a subsequent VACUUM operation. This is most useful on large tables.
The most amazing thing about this command is its’ speed. I have had to insert and remove data from a database quite often (database migration tests - migrate, see if correct, clean database, do it once again, and so on and so forth) and without truncate the only feasible solution was recreating the tables each time (the delete statement took ages). Now cleaning all tables works like a charm.
Add Your Comments »
Jun25
If you have a shared library set up on your IBM Websphere server, you might want to assign it automatically (while deploying) to an enterprise application. To do so, just create a deployment.xml file in the ear file:
<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1214386232125">
<deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1214386232125" deploymentId="0" startingWeight="1" useMetadataFromBinaries="false" enableDistribution="true" createMBeansForResources="true" reloadEnabled="false" filePermission=".*.dll=755#.*.so=755#.*.a=755#.*.sl=755" allowDispatchRemoteInclude="false" allowServiceRemoteInclude="false">
<modules […]
Continue Reading »
Filed In: Websphere IBM Technical
Jun17
Once a project designed to work on IBM Websphere approaches a final stage, our development team had slowly had to switch from deploying & testing the application on their favorite Glassfish server to IBM’s solution. There was a clear need for an automated deployment solution. In Glassfish (like in many other servers, e.g. JBoss) it […]
Continue Reading »
Filed In: Websphere IBM Technical
Jun5
Recently i was working on www.quickko.com - internet application where photographers can present their “photo of live”. When i was implementing comment submission parts of a system, i was forced to find a nice library to send form via ajax. I am a fan of jQuery thats why i decided to use jQuery form plugin […]
Continue Reading »
Filed In: AJAX Web Technical
May9
While being involved in one of Impessa projects - WorldGaming, I have got some tips from our Candian partners regarding creating a tunnels using putty
The Goal was to access some services lets say (Sun Application Server - port 8080 and MySQL - port 3306 ) on one of the servers which was part […]
Continue Reading »
Filed In: Web Online Gaming Technical Company Life