Textfile And Sql Database As Data Sources
Hi
Excuse me if this question doesn't belong in this forum. I'm new to Bartender and maybe this is knowledge that I should obtain without bothering you. But I have actually searched the web (and this forum of course) and read some whitepapers but not really found what I’m looking for.
We have Bartender and Commander. I have a textfile which will function as both a trigger and a data source, no problem so far. But the textfile doesn’t contain all data for the label so I need to query a sql database to retrieve some additional data. And for the query I need a value from the textfile.
What I tried so far is to add both the textfile and the sql database as data sources in Bartender. I join one field in the textfile to a field in the database. One record in the textfile will return exactly one record from the database. I wan’t one label for each row in the textfile.
As long as the sql database is relatively small (few records), this seems to work fine. In the preview mode in Bartender I get just as many labels that I want and with the right data from both the textfile and the database. And it also seems to work fine when I drop a textfile in the folder that Commander polls, I get my labels right. The table in our dev environment only contains 100+ rows. But the database table in our production environment contains 200000+ rows, and when I try to add that table as my second data source, Bartender seems to hang for about 40 minutes before I can continue. It doesn’t feel right, does Bartender read all records to the memory?
Should I only add the textfile as data source in Bartender and place the sql statement in some custom code somewhere? I have read about query prompts in Bartender, but it still takes the 40 minutes for me to add the table as data source before I even can start thinking about adding the query prompt. And I don’t know if a query prompt will help me because according to what i read, the data that the query prompt will use in the statement could be either static, entered by a user at print time or by a program controlling Bartender. And I just want a value from the textfile…
So, how can I get Bartender to add data to a label from both the trigger file and from a sql statement which uses data from the very same textfile (trigger file) as input to the query?
An alternative solution for me would be to make the textfiles complete, with all data needed for the labels, before they reach Bartender. But wouldn’t it be possible to do this in Bartender?
Thanks in advance
/Erik
-
Hello Erik,
It seems that BarTender is certainly having trouble sourcing all the records from such a big SQL database. I'm guessing that the SQL database is stored somewhere on your network? Could the network connection be a problem?
1. Please note that BarTender uses Windows drivers to connect to your database, could you confirm if connecting to your SQL database from a different Windows application on that same system takes so much time?
2. On this sort of cases it might be recommendable to activate the "Client Cursor" under the "Options" tab of the "File>Database Connection Setup..." option when selecting your SQL database. By using a client cursor, the database client copies the results of a selection query locally, and uses this cache to retrieve database records. Generally, the use of client cursors increases performance, since you work on a local instance of the record set.
However, client cursors do require a certain amount of allocated memory and network resources. If the data in your database is constantly changing, the client will need to regularly update the local copy from the server, which might decrease performance.
Please try it and let me know if it certainly betters your performance.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar