Hi,
I am looking for a ORM like tool to use in groovy/java to do some functional testing and came across ActiveJDBC. We are currently using Hibernate but we are not super happy with the load times.
Running ActiveJDBC with only a few table models created work perfectly and just how we like it. However when I tried adding all of our tables to model objects to the project it takes a long time to do any query.
According to the logs it registered every model and then starts to fetch the metadata, this results in excessive time to run. We have about 750 tables and I gave up after 10 minutes of runtime. I've read here(
http://www.findbestopensource.com/product/activejdbc) that ActiveJDBC supports on demand loading by default but it doesn't seem to work like that for me.
I've tried a fix where each table was it's 'own database' by using the DbName annotation but this runs into issues of opening it's own connection per table.
My models currently look like:
import org.javalite.activejdbc.Model
import org.javalite.activejdbc.annotations.Table
@Table(value="Account")
class Account extends Model{
}
The unit test is in spock:
@Unroll
def testDbNew(){
when:
def time = System.currentTimeMillis()
Base.open("oracle.jdbc.OracleDriver", "jdbc:oracle:thin:@XXXXX", "XXXXX", "XXXX")
def end = System.currentTimeMillis()
println (end - time)
time = System.currentTimeMillis()
def account = Account.findAll()
end = System.currentTimeMillis()
println (end - time)
println account
then:
assert account!=null
Base.close()
}
Thanks,
Dan