• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2122
  • Last Modified:

Mysql Temporary Table and Hibernate Connection Pooling

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
CCBRONET
Asked:
CCBRONET
1 Solution
 
kingjelyCommented:


I think temporary tables are only stored locally for that connection/session. What if you create view instead of temporary table?
0
 
CCBRONETAuthor Commented:
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
 
troublesagaCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
CCBRONETAuthor Commented:
@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
 
troublesagaCommented:
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
 
CCBRONETAuthor Commented:
the temp table is used for report generation only... on 1st login of the application connection is created and then it is pooled....
0
 
arch-itectCommented:
What is your isolation level.  If it doesn't do an implicit commit on temporary tables it might not be visible in Hibernate.
0
 
CCBRONETAuthor Commented:
Great
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now