code: private void createTables(PersistenceServiceUnit persistenceServiceUnit) throws Exception {
          // Run under a new transaction and commit right away
          LocalTransactionCurrent localTranCurrent = this.localTranCurrent;
          LocalTransactionCoordinator suspendedLTC = localTranCurrent.suspend();
          EmbeddableWebSphereTransactionManager tranMgr = this.tranMgr;
          Transaction suspendedTran = suspendedLTC == null ? tranMgr.suspend() : null;
          boolean psuIsPUSI = (persistenceServiceUnit instanceof PersistenceServiceUnitImpl) ? true : false;
  
          synchronized (persistenceServiceUnit) {
              try {
                  if (psuIsPUSI) {
                      ((PersistenceServiceUnitImpl) persistenceServiceUnit).setTransactionManager(tranMgr);
                  }
                  persistenceServiceUnit.createTables();
              } finally {
                  // resume
                  if (psuIsPUSI) {
                      ((PersistenceServiceUnitImpl) persistenceServiceUnit).setTransactionManager(null);
                  }
                  if (suspendedTran != null)
                      tranMgr.resume(suspendedTran);
                  else if (suspendedLTC != null)
                      localTranCurrent.resume(suspendedLTC);
              }
          }
      }
docs: Automatic table creation.
  
  @param persistenceServiceUnit persistence service unit
  @throws Exception if an error occurs creating tables.