• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Caused by: java.sql.SQLException: Closed Connection

 
Greenhorn
Posts: 6
jQuery Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my Hibernate Configuration file....


1) Kindly tell me which other properties do i need to configure to avoid this Exceprion...which comes daily in the morning forcing me to restart the server(weblogic 10.3)....???

2) Do I need to configure it in the Hibernate.cfg... OR it is better to create a JNDI using weblogic console....???
 
Ranch Hand
Posts: 43
Android Hibernate jQuery
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
its always best to have a connection pool (preferably from a data source).. hibernate is not very good at managing connections (especially in a production environment).

you can use c3p0 (jar files comes with hibernate) for connection pooling if you can't create a datasource.

also if both the above options are not fesiable then try reading the following.

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html (read section 3.4: optional configuration properties)

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/architecture.html#architecture-current-session
 
Jigs Gohil
Greenhorn
Posts: 6
jQuery Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Anantha...
I have created the DataSource in the weblogic...(Production Mode)
But after doing that I faced two Problems....
1) with CLOB data weblogic wrapped the result and returned it....so I have to typecast it with weblogic CLOB instead of sql CLOB...thus writing the App Server dependent code....
any alternative for this...?
2) I am having procedure doing following 2 things... i ) inserts data into Global Temporary Table (Oracle) ii) Opens a Cursor which fetches the data from the same table...
Now the problem is..When I am Using Hibernate Configuration for Connection Parameters .. the proc works absolutely fine i.e the cursor opens with correct data....
But when I use DataSource... the Proc doesn't return anything...i.e the cursor contains zero rows...

Any Idea what could the Problem....?
 
Anantha Sharma
Ranch Hand
Posts: 43
Android Hibernate jQuery
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you need to map the content as string not as a clop in hibernate... the documentation (links) has a sample program which cases a CLOB into a string...

that is the solution..


regarding the hibernate connection configuration & datasource... you need to make sure that the transaction manger used with the datasource is the correct one...
 
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic