ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 12-12-2012
Vadim Fooks's Avatar
Vadim Fooks Vadim Fooks is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 67
Downloads: 26
Uploads: 0
Thanks: 50
Thanked 24 Times in 13 Posts
Rep Power: 114
Vadim Fooks will become famous soon enough
Default Database backend best practice

What is the recommended way of integrating the database backend with FlexSim?
I tried using the db*() functions, but they only seem to work when the query is successful. Any exception results in a system dialog, which is not what I want most of the time. I have not found any way of intercepting database exceptions.
Does it mean that the backend has to be designed never to throw any exceptions? If I want to have my own exception handling (on the level of dealing with "duplicate key"/"key does not exist" type exceptions) I have to use the C++ API?
Thank you!
Vadim
Reply With Quote
The Following 2 Users Say Thank You to Vadim Fooks For This Useful Post:
Esther Bennett (12-13-2012), Jörg Vogel (12-13-2012)
  #2  
Old 12-13-2012
AJ Bobo's Avatar
AJ Bobo AJ Bobo is offline
Flexsim Senior Developer
 
Join Date: Jul 2007
Posts: 108
Downloads: 8
Uploads: 0
Thanks: 23
Thanked 89 Times in 41 Posts
Rep Power: 217
AJ Bobo is a jewel in the roughAJ Bobo is a jewel in the roughAJ Bobo is a jewel in the roughAJ Bobo is a jewel in the rough
Default

Vadim,

There is no way in Flexsim of intercepting database exceptions. Flexsim's db* commands are designed with the assumption that queries will be well-formed and meaningful. That set of commands is also designed to rely on the error messages of the client database because that way the Flexsim developers (namely, me) didn't have to worry about all the ways that something could go wrong. A meaningful error from the database is more helpful to the user than simply some sort of generic Flexsim error message.

If you want more control over your database interactions, then a custom-written Flexsim-compatible DLL is probably the best option.

A.J.
Reply With Quote
The Following 3 Users Say Thank You to AJ Bobo For This Useful Post:
Esther Bennett (12-14-2012), Steven Hamoen (12-13-2012), Vadim Fooks (12-13-2012)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to a database naren nataraj Q&A 3 09-11-2012 06:21 AM
Reading Tables from a Database !! Nischith Kashyap Q&A 6 03-03-2011 01:05 AM
Database Stored Procedures AJ Bobo Tips and Tricks 0 11-04-2010 03:09 PM
advise on using database operation David Chan Q&A 2 09-27-2010 03:38 AM
Sample Access Database Brandon Peterson Tips and Tricks 1 07-09-2008 12:15 PM


All times are GMT -6. The time now is 04:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.