title: Spring Boot CrudRepository able to read, but not write
body: <p>So I've been working on an extremely simple website over the past 2 days, but I figured it would be neat to somehow link the website with a Discord bot. For the Discord bot part, I've been using the JDA library.</p>
  
  <p>The issue I'm running in to is that I seem to be unable to use the <code>save</code> method. However, the <code>findById</code> and <code>findAll</code> seem to work perfectly fine. The way I have my code setup can be found below. </p>
  
  <pre><code>@Controller
  public class IndexController extends ListenerAdapter {
  
      private static boolean botStarted = false;
  
      @Autowired
      private NewsPostRepository newsPostRepository;
  
      @GetMapping("/")
      public String getIndex(ModelMap map) {
  
          // TODO: add news post images.
          NewsPost savedNewsPost = newsPostRepository.save(new NewsPost("Controller", "Posted through controller",
                  new byte[]{}, new Date(), true));
  
          System.out.println(savedNewsPost);
  
          return "index";
      }
  
      @GetMapping("/start")
      public String startBot() {
  
          if (!botStarted) {
              try {
                  JDA jda = new JDABuilder(AccountType.BOT)
                          .setToken("my-token")
                          .addEventListener(this)
                          .buildBlocking(); // Blocking vs async
              } catch (LoginException e) {
                  e.printStackTrace();
              } catch (RateLimitedException e) {
                  e.printStackTrace();
              } catch (InterruptedException e) {
                  e.printStackTrace();
              } finally {
                  botStarted = true;
              }
          }
  
          return "redirect:/";
      }
  
      @Override
      public void onMessageReceived(MessageReceivedEvent messageReceivedEvent) {
  
          User author = messageReceivedEvent.getAuthor();
          MessageChannel channel = messageReceivedEvent.getChannel();
          Message message = messageReceivedEvent.getMessage();
  
          if (!author.isBot()) {
              if (message.getContent().startsWith("!news")) {
                  NewsPost savedNewsPost = newsPostRepository.save(new NewsPost("Discord", "Posted through Discord",
                          new byte[]{}, new Date(), true));
  
                  System.out.println(savedNewsPost);
              }
          }
      }
  }
  </code></pre>
  
  <p>The repository:</p>
  
  <pre><code>public interface NewsPostRepository extends CrudRepository&lt;NewsPost, String&gt; {
  }
  </code></pre>
  
  <p>The weird thing is, that when I go to the index page, the <code>NewsPost</code> saves perfectly fine, and is visible in the database. </p>
  
  <p>When I try to use the Discord bot to add a <code>NewsPost</code>, it returns an object in the same way it would in the method for the index, with an ID that is not null and should be usable to find it in the database, however, this entry is nowhere to be found. No exception appears either. Keep in mind that both of these <code>save()</code> calls are identical.</p>
  
  <p>I've tried to use a service and adding <code>@Transactional</code> but so far nothing has worked. </p>