title: Room Database. Insert sucessfull but no data found
body: <p>I've got a simple Room database setup as seen below:</p>
  <p>Entity Class</p>
  <pre><code>@Entity
  public class User {
   @PrimaryKey
   public int uid;
  
   @ColumnInfo(name = &quot;first_name&quot;)
   public String firstName;
  
   @ColumnInfo(name = &quot;last_name&quot;)
   public String lastName;
  
   public User(int uid, String firstName, String lastName){
       this.uid = uid;
       this.firstName = firstName;
       this.lastName = lastName;
   }
  }
  </code></pre>
  <p>My Dao Interface:</p>
  <pre><code>@Dao
  public interface UserDao {
  
   @Query(&quot;SELECT * FROM User&quot;)
   Flowable&lt;List&lt;User&gt;&gt; getAlls();
  
   @Insert
   Completable addData(User modelClass);
  }
  </code></pre>
  <p>My Database:</p>
  <pre><code>@Database(entities = {User.class}, version = 1)
  public abstract class AppDatabase extends RoomDatabase {
  
   private static AppDatabase instance;
  
   static AppDatabase getDatabase(Context context) {
       if (instance == null) {
          instance = Room.databaseBuilder(context, AppDatabase.class, &quot;your_db_name&quot;).createFromFile(new File(&quot;mypath&quot;)).build();
       }
       return instance;
   }
  
   public abstract UserDao userDao();
  }
  </code></pre>
  <p>Finally my ViewModel:</p>
  <pre><code>public class RoomWithRxJavaViewModel extends AndroidViewModel {
  
   private AppDatabase appDatabase;
  
   public RoomWithRxJavaViewModel(@NonNull Application application) {
      super(application);
      appDatabase = AppDatabase.getDatabase(application);
   }
  
   public Flowable&lt;List&lt;User&gt;&gt; getList() {
      return appDatabase.userDao().getAlls().subscribeOn(Schedulers.computation())
              .observeOn(AndroidSchedulers.mainThread());
   }
  
   public Completable addData(User modelClass) {
  
       return Completable.fromAction(() -&gt; appDatabase.userDao().addData(modelClass))
              .subscribeOn(Schedulers.io())
              .observeOn(AndroidSchedulers.mainThread());
   }
  
  }
  </code></pre>
  <p>And my Activity where I print the results:</p>
  <pre><code>RoomWithRxJavaViewModel viewModel = new RoomWithRxJavaViewModel(this.getApplication());
  
  Disposable disposable = viewModel.addData(new User(2, &quot;btt&quot;, &quot;bbb&quot;))
  .subscribe(
   () -&gt; { //onSucess
     Toast.makeText(this, &quot;Completed!&quot;, Toast.LENGTH_SHORT).show();
     Disposable subscribe = viewModel.getList()
     .subscribe(modelClasses -&gt;
         {
           Toast.makeText(this, &quot;RoomWithRx: &quot; + modelClasses.size(), Toast.LENGTH_LONG).show();
         }, e -&gt; Toast.makeText(this, &quot;Error: &quot; + e.getMessage(), Toast.LENGTH_LONG).show());
  }, //onError
     throwable -&gt; {
       Toast.makeText(this, &quot;Error!&quot; + throwable.getMessage(), Toast.LENGTH_SHORT).show();
    }
  );
  </code></pre>
  <p>As you can see from the code, I first try creating a default user in my database.</p>
  <p>If the insert is sucessfull, which it is cause I always enter the onSucess function, i want to check the size of the updated User Table and here's the catch:
  No matter how often I insert the user using the code, the size is remains always 0.</p>
  <p>Am I missing something?</p>