On Thu, 2007-02-15 at 12:45 +0000, Graham Triggs wrote: > On Tue, 2007-02-13 at 09:52 +0000, Jim Downing wrote: > > José A. Rubio wrote: > > > java.lang.IllegalArgumentException: Value for SIZE_BYTES is not an > > > integer > > This has come up before: - > > > > https://sourceforge.net/tracker/?func=detail&atid=119984&aid=1460754&group_id=19984 > > > > > You could try the patch below.
I've now given this some more thought, and I believe the only workable solution is to always pass integer values IN to Oracle as long, and on retrieving them, assume them to always be long, then test them and if they are capable of being stored in an int, populate TableRow with an int. This should allow all the other code to work - an int goes in, an int ought to be retrievable (via getIntColumn). Anything that expects to get long, can get a long, regardless of whether it is / is capable of being an int. Only if something explicitly puts something that can't be represented as a long into the database, and then tries to getIntColumn() on retrieval, would an error arise. If you are using Postgres, then this patch doesn't change any behaviour (apart from TableRow allowing getLongValue to return the contents of an integer). I have submitted a patch implementing this as (#1660752): http://sourceforge.net/tracker/index.php?func=detail&aid=1660752&group_id=19984&atid=319984 Changes: DatabaseManager.java: execute() - add Types.NUMERIC test to the Integer if condition - when Oracle is configured, it *always* passes in longs for integer/numeric types. Behaviour for Postgres is unchanged (uses an int). process() - when Oracle is configured, for numeric types, it gets a long from the resultset. If the long can be cast to an int with no loss of data, then it uses an int for populating the TableRow - if not, it uses the long. Behaviour for Postgres is unchanged (uses an int). TableRow.java: getLongColumn() - if the column contains an Integer, allow it to be returned as a long (there is no loss of data). The table row change is required, as for Oracle we are always populating the TableRow with int values if we can represent a numeric as such without loss. We have to do that to allow for code that is expecting an int, however where code is expecting to retrieve long column, having an int value would have cause it to fail. This e-mail is confidential and should not be used by anyone who is not the original intended recipient. BioMed Central Limited does not accept liability for any statements made which are clearly the sender's own and not expressly made on behalf of BioMed Central Limited. No contracts may be concluded on behalf of BioMed Central Limited by means of e-mail communication. BioMed Central Limited Registered in England and Wales with registered number 3680030 Registered Office Middlesex House, 34-42 Cleveland Street, London W1T 4LB ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ DSpace-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dspace-tech

