New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object in use when altering tables or views [CORE2613] #3023
Comments
Commented by: @dyemanov Before going into a deep discussion, it would be appreciated if you would post an example (SQL code snippet) of what exactly works in v1.5 and doesn't work in v2.1.2. |
Commented by: Hilmar Brodner (syn) Sorry, I didn't hink it was necessary to post a snippet as this was done before in CORE888 and this is a well documented behaviour that basically affects all changes in a live environment. The problem even found its way into the release notes: Here is the SQL from CORE888 again: --------------------------------------------------- EXECUTE PROCEDURE TestProc; DROP PROCEDURE TestProc; |
Commented by: @dyemanov I've just verified: the above SQL executes without errors on v2.1.2. |
Commented by: Hilmar Brodner (syn) CREATE TABLE T1 ( CREATE TABLE T2 ( CREATE VIEW V1(
|
Commented by: @dyemanov The SQL from CORE888 still executes fine in v2.1.2 even if the EXECUTE PROCEDURE statement is done from a second client. Tested with ISQL. There are different rules for metadata modifications performed while an object is used by a prepared statement or active transaction. Originally, they were: a) you cannot drop a table or view while it's used by someone else Variations in practice: Rule (a) is accidentally broken in v1.5.2, v1.5.3, v1.5.4 and v1.5.5. These versions don't validate usage counters of metadata objects. Versions v1.5.0 and v1.5.1 (as well as all v1.0.x versions) works as expected and don't allow such modifications. So, this ticket is wrong regarding procedures and correct regarding tables/views, but the latter is only because of the bug in recent v1.5.x versions. |
Commented by: Hilmar Brodner (syn) OK, understood. I didn't differentiate between rules a) and b). I also understand that you are saying that the behaviour with regards to views and tables in FB1.5.5 is actually a bug. But that brings us back to my first point: May have been a bug, but never resulted in any harm. How do you develop a database with 20+ programmers without being able to alter views or tables without having 20+ copies of the main database? How do you update the database at a customer if you have to disconnect 100+ clients each time? We are talking high impact to the work that is being able to be done. And once again: Finally we are able to create/drop foreign keys, but no longer able to do the same for views and tables? Is there a way around this? We would love to upgrade from 1.5.5 (and our community would love us to as well) but that just wouldn't work, given that restriction. Are there any plans to reintroduce the bug from 1.5 - I know that is not the idea of progress but with regards to procedures this is what happended as well. How do others work around this problem? (Sorry for all the nagging, but this is a huge thing for us :) |
Commented by: @dyemanov In development, personally, I had no problems with 20+ copies of the database maintained in sync via the SQL script and CVS repository. In production, I would never recommend to upgrade metadata with connected users unless you understand the consequences (like users still seeing the older metadata for the whole working day). But surely these recommendations may not suit your requirements. Now, getting back to your issues, DROP TABLE and DROP VIEW seem being the only problems you experience, as we have already proved that the issue doesn't exist for procedures, there wasn't any test case for ALTER TABLE posted and there's no ALTER VIEW statement in the discussed FB versions. Here I agree that you have a problem. As for DROP TABLE, the current situation will remain the same for the foreseeable future, like it nor not. However, it seems possible to implement in-memory versioning for views, thus allowing concurrent metadata modifications (this is what works for procedures, opposite to your suggestion that they just have usage counting disabled). But this is a somewhat major change and I doubt it can be introduced in point releases of the v2.x series. It should be researched in depth before making a decision. This is unlikely to please you much, but so far I have only two suggestions for this ticket: 1) Resolve the bug as "won't fix" (i.e. everything works as designed). |
Commented by: Hilmar Brodner (syn) I'm still wondering why we are the first people to stumble across this :) Thank you for you detailed answer. I did some tests with FB2.5 (2 client connections, using IBExpert): "Object in use" with Which basically boils down to us having to wait till FB2.5 (hoping that RELAXED_ALIAS_CHECKING will still be available) - but being happy nonetheless as "ALTER VIEW" will resolve all our problems. I also found interesting that adding a new field to view "v1" with client 1 resulted in client 2 being able to see the field in a "select * from v1" without prior commit. Thank you very much for your time again. Great help! |
Modified by: @dyemanovstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Won't Fix [ 2 ] assignee: Dmitry Yemanov [ dimitr ] |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Hilmar Brodner (syn)
Votes: 1
We recently wanted to upgrade from FB 1.5 to 2.1.2. We quickly ran into problems with not being able to change procedure, views etc. due to "object in use" error message. This poses a rather big problem and ultimately results in us not being to go the step to 2.1.2.
I have searched the tracker and found multiple entries regarding this issue. This basically leads to IMHO contradicting answers on the subject:
CORE928 - 2.0 RC4
Answer: Intended behaviour, this is not a bug
CORE811 - 2.0 Beta 1
Answer: Fixed - but not for foreign keys.
CORE1081 - 2.0.0
Answer: Fixed in 2.0.1
CORE888 - 2.0 RC3
Answer: Fixed in 2.1 Alpha, 2.0.1
The question is if "object in use" message is intended behaviour and, if so
- why this has been reported as fixed multiple times
- why we have been discussing allowing to insert foreign keys while other users are logged into the db
This is impractical behaviour when working with multiple developers or at a customer. Someone said that with FB 1.5 they have been altering objects in running databases for years - without ever having a problem. We can only confirm this.
What is the inteded behaviour?
What is going to happen in the future? Is it going to stay forbidden to alter objects? Why not control it by paramter in the conf-file?
The text was updated successfully, but these errors were encountered: