You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@yrodiere , thank you for your feedback. Please find below as requested
high-level description of your problem ( Object to be persisted does not return any errors, returns an incremented value for the PK( auto incremented @id
Any relevant stacktrace (the whole stacktrace) and logs ( no errors or exceptions thrown except when the @transactional annotation is removed
profile = new ProfileSetup();
profile.createdDate = LocalDateTime.now();
profile.emailAddress = fromJson.emailAddress;
profile.firstName = fromJson.firstName;
profile.full_name = fromJson.fullName;
profile.lastName = fromJson.lastName;
profile.loginStatus = 0;
profile.mobileNo = fromJson.mobileNo;
profile.tilAccount = fromJson.tilAccount;
profile.status = ResourceStatusEnum.INACTIVE.name();
profile.userRole = fromJson.userRole;
//Panache.getEntityManager().merge(profile); // does not return an error for both merge and persist methods , but the object is not written to database
Panache.getEntityManager().persist(profile);//.merge(profile);
Panache.getEntityManager().flush();//.getTransaction()..commit();
}
else
{
return profilex;
}
}
catch (Exception e) {
e.printStackTrace();
throw new Exception(e);
}
return profile;
}
Both Panache.getEntityManager().merge(profile) and Panache.getEntityManager().persist(profile) return without errors, and the tid (PK) returns incremented and no errors, however data not persisted to database, I also tried using an Agroal Implementation where I obtained the connection object and used prepared statement executeUpdate() which returned a value of 1, yet no data in my database. Amazingly someother objects are persisting to database in the same project. Please can anyone help?
I have tried the following.
Recreate the database table
Use and Agroal implementation so I can grab the connection object and use prepare statement
Have my entity object extand PanacheEntity and used PanacheEntity.getEntityManager()
All this have not solved the issue
The text was updated successfully, but these errors were encountered:
@yrodiere , thank you for your feedback. Please find below as requested
I have an entity object
https://github.com/entity
https://github.com/table(name="profiles_logs")
public class ProfileSetup extends PanacheEntityBase implements Serializable
{
@id
@GeneratedValue(strategy=GenerationType.IDENTITY)
https://github.com/column(name="tid")
public long tid;
https://github.com/column(name="first_name")
public String firstName;
......
......
and in my Repository I am doing this
@transactional
public ProfileSetup doLog(UserProfileRequest request ) throws Exception {
ProfileSetup profile = null;
try
{
UserProfileRequestObj fromJson = new UserProfileRequestObj(request);
ProfileSetup profilex = doLookUpByName(fromJson.emailAddress,fromJson.mobileNo);
log.info("--doLookUpByParamName -- "+profile);
if(profilex == null)
{
}
else
{
return profilex;
}
}
catch (Exception e) {
e.printStackTrace();
throw new Exception(e);
}
return profile;
}
Both Panache.getEntityManager().merge(profile) and Panache.getEntityManager().persist(profile) return without errors, and the tid (PK) returns incremented and no errors, however data not persisted to database, I also tried using an Agroal Implementation where I obtained the connection object and used prepared statement executeUpdate() which returned a value of 1, yet no data in my database. Amazingly someother objects are persisting to database in the same project. Please can anyone help?
I have tried the following.
Recreate the database table
The text was updated successfully, but these errors were encountered: