Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] NPE when updating entity where only @Element-collection has changed

I have no idea (I'm just an EclipseLink user like you and never used it with PostgreSQL), but... what if you compare the same buildCallWithReturning implementation on another SQLPlatform (MySQL or such)? Would it throw NPE as well if sqlCall is null?
You may understand if the problem is in the PostgreSQLPlatform or in the fact that sqlCall is null...

Mauro

Il 02/05/2016 23:17, Andreas Joseph Krogh ha scritto:
 
Hi.
 
I'm getting bitten by this again, using EL-2.6.2. No hints of what might cause this?
 
Thanks.
 
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 
 
På mandag 11. mai 2015 kl. 22:41:21, skrev Andreas Joseph Krogh <andreas@xxxxxxxxxx>:
Hi all.
 
I'm using EL-2.5.2 with PostgreSQL
 
I have one entity where the only field changed is an @ElementCollection, this results in the following code-path:
 
SQLUpdateStatement.buildCallWithoutReturning, line 64:
 
if (fieldsForTable.isEmpty()) {
    return null;
}
 
Then null is returned and assigned to the sqlCall-variable in SQLModifyStatement.buildCall:
 
public DatabaseCall buildCall(AbstractSession session) {
    SQLCall sqlCall = buildCallWithoutReturning(session); // null is returned here
    if ((getReturnFields() == null) || getReturnFields().isEmpty()) {
        return sqlCall;
    } else {
        return session.getPlatform().buildCallWithReturning(sqlCall, getReturnFields());
    }
}
 
Using the PostgreSQLPlatform, this is what happens:
 
public DatabaseCall buildCallWithReturning(SQLCall sqlCall, Vector returnFields) {
    SQLCall call = new SQLCall();
    call.setParameters(sqlCall.getParameters()); // BOOM NPE !!!!!!!!!!
 
Has anyone else seen or been bitten by this?
 
Thanks.
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
 
 


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top