no insert after commit
hello
Im trying to insert newType to the data base "postgresql"
but I can't see it in the record when I try to use pgadmin
my connection is set to connection.setAutoCommit(false );
publicboolean new_type_vist(TypeVisit typevisit)throws DataAccessException
{
try
{
int result=0;
sqlInsertTypeVisit.setInt(1,typevisit.get_praticien().get_id_person());
if(typevisit.getType_suivant()==null)
{
sqlInsertTypeVisit.setInt(2,28);
}
else
{
sqlInsertTypeVisit.setInt(2,typevisit.getType_suivant().get_id_type());
}
sqlInsertTypeVisit.setString(3,typevisit.get_libelle_type());
sqlInsertTypeVisit.setBoolean(4,typevisit.get_visible());
sqlInsertTypeVisit.setInt(5,typevisit.getAfter_nb_of_days());
result = sqlInsertTypeVisit.executeUpdate();
if ( result == 0 )
{
connection.rollback();// rollback update
System.err.println("rool back type");
returnfalse;// update unsuccessful
}
System.out.println("new type will be commited");
connection.commit();
System.out.println("new type is commited");
returntrue;
}
catch ( SQLException sqlException )
{
sqlException.printStackTrace();
// rollback transaction
try
{
connection.rollback();// rollback update
System.err.println("rool back duree");// rollback update
returnfalse;// update unsuccessful
}
// handle exception rolling back transaction
catch ( SQLException exception )
{
thrownew DataAccessException( exception );
}
}
}
I can see the insert withen the connection ,but once Im out of the programme ,then I dont see the inserted record ?
I think it is a problem with commit ?
how can i debug this ?
do u see any thing that i cant see ?

