Results 1 to 2 of 2

Thread: application startup time

  1. #1
    Join Date
    Sep 2004
    Posts
    1

    Default application startup time

    Hi all. I'm writing a JAVA/SWT application over Spring/hibernate/MySQL.
    Everithink works well, apart from the fact that each time
    I start the application, the hbm.xml mapping files parsing
    took very long. This is quite boring in order to perform automatic testing
    especiallly, but for application every-day use as well.
    In the hibernate site I found this:
    http://www.hibernate.org/194.html
    explainig how to "cache" the parsed objects into a file and
    then lazy inizializing them t startup.
    I have no idea about how to translate this into spring..
    someone can please help?
    thanks
    davide

    ps
    I'm currently using this to create the context:
    ApplicationContext applicationContext =new FileSystemXmlApplicationContext(application_contex t_xml_file_path)

  2. #2
    Join Date
    Aug 2004
    Location
    Amsterdam, Netherlands
    Posts
    450

    Default

    Well, like the post mentioned, it's experimental and added to the hibernate3 branch.

    Anyway, if you really really like to have this in your tests, I suggest you have a look at Spring's LocalSessionFactoryBean and specifically the afterPropertiesSet() method. It builds up the configuration using the Configuration class (same as mentioned in the post). You could implement this yourself using the afterPropertiesSet() code from Spring's local session factory bean and the code from the Hibernate post you mentioned.

    Can't you test some of your mappings in isolation (just load a couple of them instead of everything) or maintain the reference to the session factory for more than just one test (use constructor instead of setUp).

    Alef

Similar Threads

  1. Replies: 2
    Last Post: Oct 10th, 2005, 05:12 PM
  2. Replies: 11
    Last Post: Jul 19th, 2005, 10:24 PM
  3. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  4. Questioning the core component
    By Martin Kersten in forum Swing
    Replies: 6
    Last Post: Feb 21st, 2005, 03:45 AM
  5. Desktop application, strange behaviour
    By innovate in forum Container
    Replies: 2
    Last Post: Sep 24th, 2004, 04:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •