Friday, October 17, 2008

MySQL issue: delete column :)

I faced very simple task: remove unused column in database table. Issue was in fact that mentioned column is a foreign key to another table.
After trying to run:
alter table table_name drop column_name;
strange message appeared:
Error on rename of '.\database\#sql-6ec-13' to '.\database\' (errno: 150)
This is because adding foreign keys also adds an index key to the table (for optimization needs).Therefore to delete mentioned column You need:
  1. Run show create table table_name and see what keys and foreign keys are created on mentioned column;
  2. Delete all keys using alter table table_name drop key key_name;
  3. Delete all foreign keys using alter table table_name drop foreign key foreign_key_name;
  4. Drop needed column alter table table_name drop column_name;
That's all.

Friday, August 1, 2008

JBoss in debug mode

You can start JBoss in debug mode. You have to edit the run.bat file to configure the debug options.
Edit the run.bat file of JBoss to use the following debug options (note the suspend=n option, this tells the server not to wait till the debugger attaches itself to the server ):

set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%

After that port 8787 can be used for debugging.

Wednesday, July 30, 2008

Old Tech Per: java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode

Old Tech Per: java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode