sql server - committed inserted data not immediately available for select involving full text search -
i have 2 stored procedures - simplified/pseudo code:
create procedure [someschema].[sproc1] begin set nocount on; begin try begin transaction x; -- insert lots of data commit transaction x; end try begin catch select @errornumber = error_number() , @errorseverity = error_severity() , @errorstate = error_state() , @errorprocedure = error_procedure() , @errorline = error_line() , @errormessage = error_message(); rollback transaction x; end catch; end; create procedure [someschema].[sproc2] begin set nocount on; begin try begin transaction x; -- perform full text search on old , inserted data , return commit transaction x; end try begin catch select @errornumber = error_number() , @errorseverity = error_severity() , @errorstate = error_state() , @errorprocedure = error_procedure() , @errorline = error_line() , @errormessage = error_message(); rollback transaction x; end catch; end;
the first stored procedure sproc1 inserts data several normalized tables. second sproc2 selects data database using full text search. run both stored procedures follows:
exec [someschema].[sproc1] exec [someschema].[sproc2]
unfortunately data inserted via sproc1 not yet available when sproc2 run - after 1-3 seconds (guesstimate). reason this? should not synchronous/atomic - i.e. data should available/selectable @ time sproc2 executes?
any suggestions enforce data insert/index completed before sproc2 invoked appreciated. thanks.
ps:
just isolated problem sproc invoked inside sproc2. sproc uses sp_executesql , not run inside transaction. not sure why causes problems though ...
pps:
it seems related full text search. part of ssdt post-deployment script:
create fulltext catalog [somefulltextcatalog] accent_sensitivity = off default; create unique clustered index clusteredindex_someview on [someschema].[someview] (someid); go create fulltext index on [someschema].[someview ]( [some1] language 'british english', [some2] language 'british english', [some3] language 'british english', [some4] language 'british english') key index [clusteredindex_someview] on ([somefulltextcatalog], filegroup [primary]) (change_tracking = auto, stoplist = system)
how can 'refresh' after insert?
i can do:
i understand can do:
select fulltextcatalogproperty('somefulltextcatalog', 'populatestatus') status
to check status of full text catalog , wait until value 0 again. possible?
do need recreated full text index again, need once day, inserted data day available.
Comments
Post a Comment