program for computing factorial using database with 2 tables: base and result

step1 - just computing factorial
step2 - computing factorial for value from base table
step3 - computing factorial for value from base table then write result value to result table
step4 - computing factorial for value from result table then write result value to the same table
then so on a few times

I use reflection and 2 threads