-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Problem with Hibernet in a Web application on Eclipse
PostPosted: Fri Jul 09, 2010 2:36 pm 
Newbie

Joined: Fri Jul 09, 2010 2:16 pm
Posts: 2
Hi....I need help...I'm new using Java and Hibernate and I'm trying to do a web application but I'm having serious problems because I'm having an error that say "No suitable driver found for jdbc:oracle:thin:@172.18.25.101:1521:ORCL" I already debug my application and I know that the error is throw when I try to begin the transaction.

Here is my .java that throws the problem

Code:
public class TestEmployee {

   /**
    * @param args
    */
   public static void main() {
      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Employee.class);
      config.configure("hibernate.cfg.xml");

      //new SchemaExport(config).create(true, true);
      
      SessionFactory factory = config.buildSessionFactory();
      Session session = factory.getCurrentSession();
      
      session.beginTransaction(); <----this line throw the error.
            
      {
         Employee alex = new Employee();
         //alex.setEmpId(100);
         alex.setEmpName("Alex Berry");
         alex.setEmpEmailAddress("alex@hibernate.com");
         alex.setEmpPassword("alexpass");
         alex.setPermanent(true);
         alex.setEmpJoinDate(new GregorianCalendar(2009,05,26));
         alex.setEmpLoginTime(Date.valueOf("2010-06-05"));
                  
         session.save(alex);   
      }   
      
      session.getTransaction().commit();

   }

}


And this is my hibernate.cfg.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@172.18.25.101:1521:ORCL</property>
        <property name="hibernate.connection.username">SERVICIOS</property>
        <property name="hibernate.default_schema">SERVICIOS</property>
        <property name="hibernate.connection.password">SERVICIOS</property>
     
        <property name="hibernate.connection.pool_size">2</property>
       
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
       
        <property name="hibernate.current_session_context_class">thread</property>
       
        <property name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
       
        <property name="hibernate.show_sql">true</property>
       
    </session-factory>
</hibernate-configuration>


The way that I'm invoking my TestEmployee.java is this:

Code:
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
//private String[] afa;
TestEmployee t = new TestEmployee();
t.main();

%>
<a>prueba</a>
</body>

<%@page import="com.hibernate.chapter1.TestEmployee"%></html>


Please help me I don't know how to solve this.
Thanks!!!! And Sorry for the English but I'm not natural speaker.


Top
 Profile  
 
 Post subject: Re: Problem with Hibernet in a Web application on Eclipse
PostPosted: Fri Jul 09, 2010 10:54 pm 
Newbie

Joined: Fri Jul 09, 2010 10:49 pm
Posts: 1
Greetings!!!
The data isnt exactly what i would call big, there is alot of records but generally the field data is small, mainly strings 15-30 characters long on average.

Can you tell me more about how the FieldCacheImpl works........what gets stored and when does it get released?? What happens for example when the slave directory switches over to the new index, does fieldcacheimpl still store all the old values from the old index or does it release them? My hunch is maybe after switching X amount of times that maybe the FieldCacheImpl still holds the old index values in memory and this builds up over time?? It is just a hunch/theory at the moment and i need to prove it.
how to hypnotize someone


Top
 Profile  
 
 Post subject: Re: Problem with Hibernet in a Web application on Eclipse
PostPosted: Mon Jul 12, 2010 1:55 pm 
Newbie

Joined: Fri Jul 09, 2010 2:16 pm
Posts: 2
I don't know what is this FieldCacheImpl that you're talking about.
Other thing that I don't understand is the slave directory that asking for.
Could you please be more specific with what thing you want to see or what thing should I review in my code.

Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.