• Post Reply Bookmark Topic Watch Topic
  • New Topic

problems with save method with hibernate

 
Jordi Maicas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,

I'm doing a simple application with hibernate, but I've got an strange problem. Inside Netbeans 7.0, If I run the app, it works fine so.... the record is saved. But If I run the jar, outside netbeans, it doesn't save the record.

Any ideas?

I tryied using,

session.save(hoja);
session.flush();
tx.commit();
session.close();
dispose();

Thank you.

 
Sumit Bisht
Ranch Hand
Posts: 331
Python Ruby Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd guess your classpath dependencies are not getting exported properly. Also, is the datasource you are using (alongwith the drivers available as a library in your project) accessible from outside.
Can you (log/print) output your save method in detail outside the IDE ?
 
Jordi Maicas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where could I see the log? Mmmm, ok. show_sql.

That's all! I find the error with the log; I need to add some JAR (I don't understand why... but If I added the JAR's it works outside netbeans).

These are the links to obtaing the JAR's required:

http://www.slf4j.org/manual.html
http://commons.apache.org/collections/download_collections.cgi

Thank you.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!