Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Application crashes when connected to MySQL, what am I doing wrong?
Re: Application crashes when connected to MySQL, what am I doing wrong? [message #45137 is a reply to message #45113] Mon, 14 September 2015 08:33 Go to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
void MyApplication::MyQuery1()
			//Here's my query
                        int ritorno = Select(SqlSum(N_BOB))
			.From(PEZZATURE)
			.Where( COMM == ~dlgSceltaPezzature.strLav3A );


Not that this is not correct. This is not executing query, just creates Select structure and converts it to bool (->true -> 1).

You should use something like

void MyApplication::MyQuery1()
			//Here's my query
                        int ritorno = my_sql_session % Select(SqlSum(N_BOB))
			.From(PEZZATURE)
			.Where( COMM == ~dlgSceltaPezzature.strLav3A );


Anyway, as for your original problem, hard to say what was causing the issue. Technically, creating session for each query should work. However, it is not a good idea at all, usually creating (and destroying) session takes certain amount of time, so it is ineffective.

As 90% of applications work with just single SQL backend, we have that global SQL session support....

Mirek
 
Read Message
Read Message
Read Message
Previous Topic: Accessing Database from multiple files
Next Topic: PATCH/BUGFIX Oracle global temporary table
Goto Forum:
  


Current Time: Wed Jun 25 12:04:33 CEST 2025

Total time taken to generate the page: 0.03973 seconds