sure nandu

Greenhorn
+ Follow
since Oct 16, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sure nandu

thanks Paul Sturrock for your detailed reply.

in my hibernate-cfg.xml i have mentioned connection pool as

<property name="hibernate.connection.pool_size">10</property>
so please tell me whether i have to increase this value.



and secondly i have closed all the sessions in each of add, delete,edit methods. i also need to know doing like this is wrong.


regards
nandu
hai friends,

i have a application where i have to add,delete,edit. i have used hibernates and created seperate methods for each operation. after adding some 80-90 values it is showing following exception.

Data source rejected establishment of connection, message from server: "Too many connections"
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:649)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1786)
at com.mysql.jdbc.Connection.<init>(Connection.java:450)
at com.mysql.jdbc.NonRegisteringDriver.connect(at java.lang.Thread.run(Unknown Source)
16:53:12,687 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:mysql://localhost/test
16:53:12,687 WARN JDBCExceptionReporter:57 - SQL Error: 1040, SQLState: 08004
16:53:12,687 ERROR JDBCExceptionReporter:58 - Data source rejected establishment of connection, message from server: "Too many connections"


i think too many connection are created. so i wanted to know how to use a single connection. Should i use singleton pattern while creating SessionFactory object ? and also i need to know when exactly connection gets created. ie
1)while creating SessionFactory object
2)or while creating Session object
hai friends,
iam very new to hibernates world.iam comfortable with
selecting from database. i wanted to know how to give edit command.

i wanted equivalent of following sql command.

"update technology set tech_name='struts' where tech_name='springs'";

thanks in advance. regards
nandu
Thanks for your wonderful book. it was so simple and easy to
learn.
wish you good luck for your future plans.
17 years ago
thanks for the reply.
In one of the seminars i attended on hibernates i got this question.
so i just wanted to know whether it is possible to use 2 databases from hibernates in a single application.
hai naga ravipati,

try putting both hibernate.cfg.xml and department.hbm.xml
in to classpath and run the application. please tell about the result.
hai everybody,

i just wanted to know how can we use 2 databases using hibernates.
--> to create some tables in mysql server and some other databases
in say oracle server. we can define 2 sessionfactory in
<hibernate-configuration>. but how to specify specific table to be created
in particular database.
if anyone knows please reply.any response will be appreciated. thank you.

regards
nandu
thanks merill for yor detailed reply.

i will try to search a plugin.
17 years ago
thanks both of you(pascal betz and Amirtharaj Chinnaraj)
for your answers.
thanks amritharaj for your reply.

can you please eloborate for your answer?
that is when exactly is those files( hibernate.cfg.xml and mapping.hbm.xml)
gets called. or in other words can you tell me when does it get called--->
1) while creating SessionFactory.
2)while creating Session.
3) while beggining transaction.

or which class in hibernate.jar will call those files.
hai everybody,


iam a bit new to hibernates. so i did a simple application using hibernates in struts framework. i had not mentioned any plugin in struts-config.xml. but the application was working fine. iam very confused that how did the struts came to know about the location of
my hibernate.cfg.xml and mapping.hbm.xml. but both files was set in my classpath. if anybody knows the answer please inform.
thanks in advance.
17 years ago
hai everybody,


iam a bit new to hibernates. so i did a simple application using hibernates in struts framework. i had not mentioned any plugin in struts-config.xml. but the application was working fine. iam very confused that how did the struts came to know about the location of
my hibernate.cfg.xml and mapping.hbm.xml. but both files was set in my classpath. if anyone knows please inform. thanks in advance.
there was also mistake in 'validwhen' field
17 years ago
hai Merrill Higginson,

actually i had done mistakes in my jsp page(i had given action wrong). your suggestion helped me a lot. thanks a lot.
17 years ago
hello everybody,

iam doing validation using Struts validator.(validation.xml) i have a jsp page with 3 buttons add,edit,delete.
i have one field department. i have used DispatchAction with three methods
add,edit,delete. if i press add button i will send a "add" value from jsp page with <html:hidden>. this will call add method of DispatchAction.
which inturn add department field to persistent store and go back to my jsp page.

when i donot give any value in department field IT WILL SHOW ME THAT DEPARTMENT FEILD IS REQUIRED.BUT THE ADD METHOD OF MY DISPATCHACTION GETS CALLED AND BLANK VALUE IS ENTERED IN DATABASE.ACTUALLY ADD METHOD OF DISPATHACTION MUST NOT GET CALLED.

if any one has faced similar problem please tell me the solution.

thanks in advance.
17 years ago