-36

My latest question has been closed. I find the reason contrived.

Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.

Desired behavior – right there. I couldn't be clearer

First, to check the existence of the required table. If it's absent, create it according to my schema.sql file. If it's present, update it according to the code in the @Entity class

Second, fill the users tables with sample rows if it's empty and ensure the roles table has at least a row with role = 'USER' and a row with role = 'ADMIN'. Also, fill the @JoinTable so that every user is a USER, and the first user is also an ADMIN

A specific problem – right there. I even used the word "specifically"

Now, it doesn't seem to work. Specifically, data.sql doesn't seem to have any effect as the first user in the users table is still not an ADMIN after the application's startup

"The shortest code necessary to reproduce the problem". Not possible. However, I did my best and included all the properties and the SQL I used and even gave a link to a dbfiddle which makes the code runnable. I don't know how to make native runnable SQL snippets, only HTML. You can look at my previous questions (as you do to anyone who dares post on Meta) and see for yourself that I included high-quality runnable snippets whenever possible

The fact that you can get away with it, just make things up and arbitrarily close questions, is beyond me. There must be some check on you. For example, one should be able to appeal moderation decisions to an independent oversight body that has the authority to suspend moderator privileges in case they are abused (in my opinion, it's exactly what happened in this case). Or strip them altogether if it becomes a common practice.

27
  • 2
    The fact you need to start of with a paragraph that says your questions look the same, are the same (to start with), but aren't the same suggest to me that you aren't writing a question unique to the problem you are asking about.
    – Thom A
    Apr 19, 2023 at 7:45
  • 10
    "Not possible." Why? There are multiple tables and many, many fields in your schema. Aren't there any that you can remove? Judging from the problem description, you may need all tables but only enough fields to identify users and assign them a role. All of username, department, salary, last name, … are just noise. Apr 19, 2023 at 7:46
  • 24
    ""The shortest code necessary to reproduce the problem". Not possible." Of course it is possible. You can reproduce the problem; you use code to do so; therefore there is at least one possible "code sufficient to reproduce the problem". Of all such possible variants of the code, at least one is shortest; that's all we're looking for. "I don't know how to make native runnable SQL snippets" You can't, but we don't require that. What we require is that we can copy and paste the code, without adding or changing anything, to reproduce the problem for ourselves locally. Apr 19, 2023 at 9:03
  • 11
    "I find the reason contrived" - the part that you quote is boilerplate text pulled from a database. We are not able to edit it. The corresponding close reason is called "Needs Debugging Details". Apr 19, 2023 at 9:09
  • 20
    "as you do to anyone who dares post on Meta"... "The fact that you can get away with it, just make things up and arbitrarily close questions, is beyond me. There must be some check on you.... Shame." Bluntly: You do not understand policy better than the people who voted to close the question, who were required to gain experience using the site in order to have the privilege of voting. There is already a check there: three independent people had to vote for closure. And none of those people are "moderators". Apr 19, 2023 at 9:12
  • 19
    As a general rule for life: if you want to appeal against what you see as some injustice, and you come to the home of those who you think did wrong, you should not start by throwing accusations about what happened. You should also make sure you can show that you understand the process that was followed. In a criminal case, I hope you would not refuse the help of a lawyer and then start your opening argument with "Your Honour, I believe the jury is conspiring against me". Apr 19, 2023 at 9:13
  • 3
    @KarlKnechtel What you wrote seems to be an answer but posted as comment. Else, it seems right
    – Elikill58
    Apr 19, 2023 at 9:45
  • 3
    (Baeldung is usually reputable, but I have seen the first article that was very likely completely generated by ChatGPT (and, as far as I can tell, is completely bogus. E.g., it seems to format most of the disk as a partition of type 'EFI system partition' and mount it as </boot/efi>... It is only supposed to take up a small fraction of the disk, like 0.3 - 0.8 GB).) Apr 19, 2023 at 13:03
  • 3
    Or in other words, anything published after November 2022 should be looked at with suspicion. Before December 2022, some articles were left out (their copy editing was not 100% effective). That is not the case for an AI-generated article. Apr 19, 2023 at 13:15
  • 3
    This seems to be a misunderstanding regarding the meaning of "runnable". It does not mean "executable directly within Stack Overflow". It does mean executable by someone with the appropriate environment who copies your posted code.
    – beaker
    Apr 19, 2023 at 17:37
  • 3
    @Sergey: "I don't know what's causing it. How do I know what to copy and paste then?" -- this suggests that you may have better luck by doing more debugging, if only to isolate the source of the problem. I have found that questions are often closed due to this problem -- the OP's not having yet done enough to isolate the source. Apr 20, 2023 at 0:05
  • 4
    @Sergey "It wasn't closed because of excessive columns." I would have closed even for that reason alone. It is something the question author can trivially fix. Not doing so makes the question more difficult to answer (everyone has to identify and exclude the irrelevant parts themselves) and to reuse (everyone with a similar issue has to identify if the extra noise is significant for their case). It doesn’t say minimal reproducible example just to annoy question askers. Apr 20, 2023 at 5:15
  • 1
    "I don't know what's causing it." Then you aren't yet ready to ask a question on Stack Overflow. We don't find the bug for you. And, yes, if it wasn't "closed because of excessive columns", it should have been. Apr 20, 2023 at 6:49
  • 3
    "The shortest code necessary to reproduce the problem". Not possible - of course it is possible. Shortest code does not imply it is short, it only implies that you should not add code which is not relevant to the question. The less readers have to wade through, the more chance you have of receiving an answer. Essentially you have to think about it and not just lazily dump everything you have.
    – Gimby
    Apr 21, 2023 at 12:27
  • 2
    @Sergey Sufficient to solve isn’t sufficient for an MRE. We’re not here to just help you. We all - including you - should create Q&A that help as many people as possible. That includes critically to use minimal code samples that focus only on a specific issue and can be easily identified to cover similar problems. Apr 22, 2023 at 6:18

2 Answers 2

17

Firstly, your question includes an explanation about why it's not linked with your last one. As a reader, it seems disturbing: I never see others of your posts, and if it doesn't help for the question (like explaining similar things), I think it should not be mentioned (except if someone in a comment told about it, which is not the case here).

Then, "It doesn't work" is not enough. We know it doesn't, else you would not post the question. The problem is what is not working exactly? Are all tables created, except one? No one? Did the sql file not run?

Also, the SQL file works, but not always, maybe it's because of what is running the file. Did you run it on phpMyAdmin, which can show the log? Did you use the MySQL command line to check if your file was correct? Did you only try with your Java program, and so maybe Java failed to find the file? Do you have logs on Java?

To conclude, I wrote a lot of question in my answer. It's not necessary to answer all one-by-one, but it's only to tell you that yes, there is missing information for us to determine what the answer is, as we could not see where is the issue. Don't add your full Java code, but search where it comes from, and be sure if it's Java-related or not.

2
  • "Now, it doesn't seem to work." was directly followed by "Specifically, data.sql doesn't seem to have any effect as the first user in the users table is still not an ADMIN after the application's startup". So I did answer "what is not working exactly?" Apr 19, 2023 at 23:24
  • 2
    @Sergey No, saying my car doesn't work fine because I can't use it is not an explaination. It will be if I say I can't accelerate, can't start it etc... This sentence just say something gone wrong and so, no changes have been made
    – Elikill58
    Apr 20, 2023 at 6:04
10

"I find the reason contrived"

Well, yes, that sentence was deliberately created. The community and staff discussed and debated (at great length) what to provide askers in terms of guidance regarding their closed questions. Not sure what you meant but perhaps 'contrived' is the wrong word here.

"The shortest code necessary to reproduce the problem". Not possible.

If you have too much code to fit into a question (which I doubt; the character limit of a post is quite high), then your question is probably too broad for Stack Overflow, or you are not truly at the point of having an MCVE/MRE (see the M, for Minimal).

I don't know how to make native runnable SQL snippets, only HTML.

If you only know HTML, then trying to use Java Hibernate and SQL to generate/automate a database creation is probably not a question you should be asking on Stack Overflow; you probably lack the minimal understanding needed to ask effectively, let alone understand the solution provided by a user, if one is provided. Instead, I would recommend following some tutorials or course instruction on SQL and on Java in general, and then once you're comfortable with writing SQL and using Java/Hibernate, try this task again.

The fact that you can get away with it, just make things up and arbitrarily close questions, is beyond me.

We have several prescribed closure reasons; the one that was used for your question was "needs debugging details". That being said, Stack Exchange sites do allow custom closure reasons because not every question that is off-topic fits well within one of those prescribed reasons... sometimes we have to color outside the lines. This is not, however, a sign of some rampant abuse or systemic problem; it's also not the case for your question, as mentioned above.

There must be some check on you. For example, one should be able to appeal moderation decisions

There is a mechanism in place for reversing question closure: reopen voting. You can flag your own question for reopening if you think it was incorrectly closed, and can explain in an edit or comment why you think so. However, it will take three other users (or two plus yourself, if you have 3,000 or more site reputation) to cast reopen votes on it before it is reopened. These users have to be convinced the question is worth reopening. The consequence of this is that questions are not likely to be reopened without edits by the asker, since questions usually aren't closed for glaring, obvious incorrect reasons. It does happen, but usually there is some merit to both sides' views.

1
  • No, I don't "only know HTML". It's not what I wrote there Apr 19, 2023 at 23:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .