Solved

Mysql Temporary Table and Hibernate Connection Pooling

Posted on 2010-08-12
8
2,052 Views
Last Modified: 2013-11-24
Hi,
Im Using:
Mysql 5.47
Glassfish Server
Hibernate for Mapping and C3P0 connection pooling

Im facing a problem in using temporary table with union with another table in my project... whenever i try to run it through my application it says cant reopen the table...

Please help



0
Comment
Question by:CCBRONET
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 8

Expert Comment

by:kingjely
ID: 33427146


I think temporary tables are only stored locally for that connection/session. What if you create view instead of temporary table?
0
 

Author Comment

by:CCBRONET
ID: 33427190
nope view wont help coz i need some columns in row format and some data from another table wise which need to be clubed...
0
 
LVL 1

Expert Comment

by:troublesaga
ID: 33427271
You could create a permanent table in tempdb or another database and truncate it after every use.
If the table is in a normal database then truncate will cause problems with transaction log dumps.
The table would need to be re-created after every recycle of the server.

You can use a view to club data from multiple tables.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:CCBRONET
ID: 33427573
@troublesaga:
 permanent table in tempdb or another database wont help me coz im using hibernate for connection
also cant use permanet table in main DB coz in using temporary table for reports so mutiple users will use the table at same time.
also view will be very complex and time consuming in select statement
0
 
LVL 1

Expert Comment

by:troublesaga
ID: 33428437
Have you tried creating the temp table as part of opening up the database connection?
I know that under Sybase you cannot create a temp table using hibernate as hibernate does everything in a transaction and Sybase doesn't allow you to create a temporary table within a transaction.
0
 

Author Comment

by:CCBRONET
ID: 33428735
the temp table is used for report generation only... on 1st login of the application connection is created and then it is pooled....
0
 
LVL 2

Accepted Solution

by:
arch-itect earned 500 total points
ID: 33491725
What is your isolation level.  If it doesn't do an implicit commit on temporary tables it might not be visible in Hibernate.
0
 

Author Closing Comment

by:CCBRONET
ID: 33616021
Great
0

Featured Post

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question