Sharding-jdbc loop insert Times error

use sharding-jdbc to divide the table, and there is no problem when operating the jpa, used by the database to insert a single piece of data:

for (int i = 1; i < 10; iPP) {
    Sharding sharding = new Sharding();
    sharding.setAppId("1001");
    sharding.setNum(i);

    shardingRepository.save(sharding);
}

the error message is as follows:

javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [com.zkzong.sj.entity.Sharding-sharp1]

what is the reason for this?

Apr.04,2021

encountered the same problem. Has it been solved?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e60a4f-27e02.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e60a4f-27e02.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?