Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubles as properties throw java.nio.BufferOverflowException when saving #6

Open
beacon50 opened this issue Jul 21, 2010 · 1 comment

Comments

@beacon50
Copy link

I have a simple Loan object:

[Comment="Loan"]
ColumnFamily Loan
{
[Index]
String loanID;

SuperFamily info
{
    String address;
    String city;
    String state;
    String zip;

    Double unpaidBalance;
    Int payoffDate;
    Int accountingPeriod;
}

Yet, when I try and set the unpaidBalance

ln.setUnpaidBalance(150000);

I get

Exception in thread "main" java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Unknown Source)
at java.nio.HeapByteBuffer.putDouble(Unknown Source)
at com.kissintelligentsystems.ocm.java.BaseTable.fromDouble(BaseTable.java:78)
at com.b50.Loan.save(Loan.java:330)
at com.b50.LoanInAction.main(LoanInAction.java:41)

It even happens if I set the value to 5 or 5d or new Double(5). I'm not sure why this happens as I see that you've allocated the size to 4.

@beacon50
Copy link
Author

It appears to happen for Longs as well (as I updated my spec to use Long). But it worked for Int (that is, ln.setUnpaidBalance(150000); worked when unpaidBalance is defined as an Int).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants