Solved

Mysql Temporary Table and Hibernate Connection Pooling

Posted on 2010-08-12
8
1,984 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
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySql hide the stored procedures 2 48
servlet example issue 6 38
arguments to jar 5 26
How to update the value of duplicated records (except latest one) 2 18
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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.

785 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