SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Apply snippet crashes SSMS

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Apply snippet crashes SSMS
Author Message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Apply snippet crashes SSMS Reply with quote
5.0.97 Pro
SSMS

Snippet:
Code:
$PROMPT(proc_name,Enter new procedure name)$
IF OBJECT_ID('$proc_name$') IS null
   Exec ('Create procedure $proc_name$ AS')
GO

/***********************************************************
* Procedure description:
* Date:   $DATE$
* Author: $OSUSER$
*
* Changes
* Date      Modified By         Comments
************************************************************
*
************************************************************/


Alter PROCEDURE $proc_name$
(
   |
)
AS
BEGIN
   SET NOCOUNT ON
   
   
   
   RETURN 0
END

In SSMS open a query window and use the above snippit. Go to the options from the tray and change the snippet by removing the pipe | and move it to another location. Then click apply. SSMS crashes.
Wed Jul 07, 2010 6:05 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Hi,

This is well known issue, not related to code snippets. Updating SQL Assistant options via system tray icon may crash target editors in which SQL Assistant plugin is loaded. This happens when the plugin cannot be dynamically unloaded and reloaded in response to changes in global options. The solution in this case is using plugin's menu to open and change SQL Assistant options local to plugin. In this case no reloading is necessary and there are no crashes. By local options/menu I mean right-click menu in SSMS or SQL Assistant top level menu within SSMS menu, Options item in that menu.
Wed Jul 07, 2010 7:22 pm View user's profile Send private message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Reply with quote
I keep forgetting (or thinking you found a workaround). If you can detect that there are targets open and active, maybe a note somewhere on the options window that you should alter options through the add-in. Maybe it will prevent some people from attempting it and serve as a reminder. An idea.
Thu Jul 08, 2010 8:57 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
I'm sorry for the inconvenience caused by the current implementation. We have made some changes in the way this stuff is handled, precisely to avoid plugin crashes. This fix should be available in 5.1 maintenance release.
Thu Jul 08, 2010 9:17 am View user's profile Send private message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Reply with quote
The right-click option change of snippet just crashed my SSMS also. Steps:

Run a snippet.
Make changes in the query window to the snippet.
Copy the snippet
Open options from right-click (Selecting Options...)
Open the settings for that same snippet.
Past the code.
Click Ok.

Note: Right Click, Code Snippets, Modify... works fine.
Thu Jul 08, 2010 4:59 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
I had similar issues in the past I posted here: http://www.softtreetech.com/support/phpBB2/viewtopic.php?t=23139&highlight=snippet.

I tried to narrow down the cause. It only happens after using (not changing) any snippet involving $OBJECT$. After that changing any snippet the crash occurs. Using other ones not containing $OBJECT$ do not seem to trigger the crash after applying changes. Could you check if your problem is the same, please?
Thu Jul 08, 2010 5:52 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
I'm pretty sure it is not related to any particular snippet code. The entire plugin is reloaded after each global options change (done via systray icon). The plugin doesn't know what has changed exactly and so it needs to re-initialize all internal caches and structures, db managers, db connections, etc… If some internal connections aren't initialized, closed, opened, etc… I don't exactly know which ones, the plugin may fail to unload cleanly and that could lead to a crash of the entire target IDE.

To avoid that, please use local options modified via the plugin owned menu. This method doesn't require the plugin to reload everything. Snippets can also be modified via the Modify Snippet menu.
Thu Jul 08, 2010 7:34 pm View user's profile Send private message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Reply with quote
SysOp wrote:
To avoid that, please use local options modified via the plugin owned menu. This method doesn't require the plugin to reload everything. Snippets can also be modified via the Modify Snippet menu.


This isn't working great either. My reply at 3:59 provided steps that caused a crash as well while using the plugin owned menu.
Mon Jul 12, 2010 9:17 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
I'm sorry to hear that. Hope the new version will work better for you.
Mon Jul 12, 2010 10:36 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.